Gmedia Photo Gallery - Version 1.3.7

Version Description

  • Fixed css on Modules page
Download this release

Release Info

Developer pasyuk
Plugin Icon 128x128 Gmedia Photo Gallery
Version 1.3.7
Comparing to
See all releases

Code changes from version 1.2.6 to 1.3.7

access.php CHANGED
@@ -2,104 +2,104 @@
2
  //ini_set('display_errors', '1');
3
  //ini_set('error_reporting', E_ALL);
4
 
5
- if(!defined('ABSPATH')){
6
- die(0);
7
  //@require_once(dirname(__FILE__) . '/config.php');
8
  }
9
 
10
  global $wp;
11
- $gmedia_app = isset($_GET['gmedia-app'])? $_GET['gmedia-app'] : (isset($wp->query_vars['gmedia-app'])? $wp->query_vars['gmedia-app'] : false);
12
- if(!$gmedia_app){
13
  die();
14
  }
15
 
16
  global $gmCore;
17
  $out = array();
18
 
19
- if(isset($_FILES['userfile']['name'])){
20
- $globaldata = isset($_POST['account'])? $_POST['account'] : false;
21
- if($globaldata){
22
- $globaldata = stripslashes($globaldata);
23
  }
24
- } else{
25
- $globaldata = isset($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : false;
26
  }
27
 
28
- if($globaldata){
29
 
30
- $json = json_decode($globaldata);
31
 
32
- require_once(dirname(__FILE__) . '/inc/json.auth.php');
33
  global $gmAuth;
34
  $gmAuth = new Gmedia_JSON_API_Auth_Controller();
35
 
36
- if(isset($json->counter)){
37
- gmedia_ios_app_counters($json->counter);
38
- }
39
-
40
- if(isset($json->cookie) && !empty($json->cookie)){
41
- $user_id = $gmAuth->validate_auth_cookie($json->cookie);
42
- if($user_id){
43
- $user = wp_set_current_user($user_id);
44
- if(isset($json->add_term)){
45
- $out = gmedia_ios_app_processor('add_term', $json->add_term);
46
- } elseif(isset($json->delete_term)){
47
- $out = gmedia_ios_app_processor('delete_term', $json->delete_term);
48
- } elseif(isset($json->doLibrary)){
49
- $job = gmedia_ios_app_processor('do_library', $json->doLibrary);
50
- $out = gmedia_ios_app_processor('library', $json->library, false);
51
- $out = array_merge($out, $job);
52
- } elseif(isset($json->library)){
53
- $out = gmedia_ios_app_processor('library', $json->library);
54
  }
55
 
56
 
57
- } else{
58
- $out['error'] = array('code' => 'wrongcookie', 'message' => 'Not Valid User');
59
  }
60
- } elseif(isset($json->login)){
61
- $out = gmedia_ios_app_login($json);
62
- if(!isset($out['error'])){
63
- $user = wp_set_current_user($out['user']['id']);
64
-
65
- $gmedia_capabilities_list = array(
66
- 'gmedia_library'
67
- , 'gmedia_show_others_media'
68
- , 'gmedia_edit_media'
69
- , 'gmedia_edit_others_media'
70
- , 'gmedia_delete_media'
71
- , 'gmedia_delete_others_media'
72
- ,'gmedia_upload'
73
- ,'gmedia_terms'
74
- , 'gmedia_album_manage'
75
- , 'gmedia_tag_manage'
76
- , 'gmedia_terms_delete'
77
- );
78
- $gmedia_capabilities = array();
79
- foreach($gmedia_capabilities_list as $cap){
80
- $gmedia_capabilities[$cap] = current_user_can($cap);
81
- }
82
-
83
- $out['user']['gmedia_capabilities'] = $gmedia_capabilities;
84
-
85
- $data = gmedia_ios_app_library_data();
86
- $out = $out + $data;
 
 
 
 
 
 
87
  }
88
- } else{
89
- if(isset($json->library)){
90
- $out = gmedia_ios_app_processor('library', $json->library);
91
- } else{
92
- $out = gmedia_ios_app_library_data();
93
- }
94
  }
95
 
96
- } elseif('lostpassword' == $gmCore->_get('action')){
97
- if(function_exists('wp_lostpassword_url')){
98
  $url = wp_lostpassword_url();
99
- } else{
100
- $url = add_query_arg('action', 'lostpassword', wp_login_url());
101
  }
102
- wp_redirect($url);
103
  exit;
104
  }
105
 
@@ -109,31 +109,31 @@ if($globaldata){
109
  *
110
  * @return array
111
  */
112
- function gmedia_ios_app_login($json){
113
  global $gmAuth;
114
 
115
- do{
116
- if(empty($json->login)){
117
- $out['error'] = array('code' => 'nologin', 'title' => 'No Login', 'message' => 'No Login');
118
  break;
119
  }
120
- if(!isset($json->password) || empty($json->password)){
121
- $out['error'] = array('code' => 'nopassword', 'title' => 'No Password', 'message' => 'No Password');
122
  break;
123
  }
124
- if(!($uid = username_exists($json->login))){
125
- $out['error'] = array('code' => 'nouser', 'title' => 'No User', 'message' => 'No User');
126
  break;
127
  }
128
 
129
  $args = array(
130
  'username' => $json->login,
131
  'password' => $json->password,
132
- 'nonce' => wp_create_nonce('auth_gmapp')
133
  );
134
- $out = $gmAuth->generate_auth_cookie($args);
135
 
136
- } while(0);
137
 
138
  return $out;
139
  }
@@ -143,35 +143,35 @@ function gmedia_ios_app_login($json){
143
  *
144
  * @return array
145
  */
146
- function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag')){
147
  global $user_ID, $gmCore, $gmDB, $gmGallery;
148
 
149
  $out = array();
150
 
151
- if(get_option('permalink_structure')){
152
- $ep = $gmGallery->options['endpoint'];
153
- $share_link = home_url($ep . '/$2/$1');
154
- } else{
155
- $share_link = home_url('index.php?gmedia=$1&type=$2');
156
  }
157
 
158
- if(in_array('site', $data)){
159
  $out['site'] = array(
160
- 'title' => get_bloginfo('name'),
161
- 'description' => get_bloginfo('description')
162
  );
163
  }
164
- if(in_array('authors', $data)){
165
  $out['authors'] = array(
166
  'data' => array()
167
  );
168
  //if(current_user_can('gmedia_show_others_media') || current_user_can('gmedia_edit_others_media')){
169
- $authors = get_users(array('who' => 'authors', 'orderby' => 'display_name'));
170
- if($authors){
171
- foreach($authors as $author){
172
- $out['authors']['data'][] = array('id' => $author->ID, 'displayname' => $author->display_name, 'firstname' => $author->first_name, 'lastname' => $author->last_name);
173
- }
174
  }
 
175
  /*} else{
176
  $authordata = get_userdata( $user_ID );
177
  $display_name = $authordata->display_name;
@@ -180,11 +180,11 @@ function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter',
180
  $out['authors']['data'][] = array('id' => $user_ID, 'displayname' => $display_name, 'firstname' => $first_name, 'lastname' => $last_name);
181
  }*/
182
  }
183
- if(in_array('filter', $data)){
184
  $out['filter'] = $gmDB->count_gmedia();
185
- $out['filter'] = array_map('intval', $out['filter']);
186
  }
187
- if(in_array('gmedia_category', $data)){
188
  /*
189
  if($user_ID){
190
  $cap = (is_super_admin($user_ID) || user_can($user_ID, 'gmedia_category_delete'))? 4 : (user_can($user_ID, 'gmedia_category_edit')? 2 : 0);
@@ -192,75 +192,90 @@ function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter',
192
  $cap = 0;
193
  }
194
  */
195
- $gmediaTerms = $gmDB->get_terms('gmedia_category', array('fields' => 'name=>all'));
196
- $terms = array_merge(array('0' => __('Uncategorized', 'gmLang')), $gmGallery->options['taxonomies']['gmedia_category']);
197
  $out['categories'] = array(
198
  'list' => $terms,
199
- 'cap' => 0,
200
  'data' => array()
201
  );
202
- if(!empty($gmediaTerms)){
203
- foreach($gmediaTerms as $name => $term){
204
- unset($gmediaTerms[$name]->description, $gmediaTerms[$name]->global, $gmediaTerms[$name]->status);
205
- $gmediaTerms[$name]->title = $terms[$name];
206
- $gmediaTerms[$name]->sharelink = str_replace(array('$1', '$2'), array($term->term_id, 'category'), $share_link);
207
- $gmediaTerms[$name]->cap = 0;
208
  }
209
 
210
- $out['categories']['data'] = array_values($gmediaTerms);
211
  }
212
  }
213
- if(in_array('gmedia_album', $data)){
214
- if($user_ID){
215
- $cap = (is_super_admin($user_ID) || user_can($user_ID, 'gmedia_album_delete'))? 4 : (user_can($user_ID, 'gmedia_album_edit')? 2 : 0);
216
- } else{
217
- $cap = 0;
 
 
 
 
 
 
 
 
 
 
 
218
  }
219
- $gmediaTerms = $gmDB->get_terms('gmedia_album');
220
- foreach($gmediaTerms as $i => $term){
221
- $author_id = $term->global;
222
- if($author_id) {
223
- $authordata = get_userdata( $author_id );
224
- $display_name = $authordata->display_name;
225
- $first_name = $authordata->first_name;
226
- $last_name = $authordata->last_name;
227
- } else{
228
- $display_name = __('Shared', 'gmLang');
229
- $first_name = $last_name = '';
230
- }
231
- $gmediaTerms[$i]->user = array('id' => $author_id, 'displayname' => $display_name, 'firstname' => $first_name, 'lastname' => $last_name);
232
-
233
- if($term->count){
234
- $args = array('no_found_rows' => true, 'per_page' => 1, 'album__in' => array($term->term_id));
235
- $termItems = $gmDB->get_gmedias($args);
236
- $gmediaTerms[$i]->thumbnail = $gmCore->gm_get_media_image($termItems[0], 'thumb', false);
237
  }
238
- $term_meta = $gmDB->get_metadata('gmedia_term', $term->term_id);
239
- $term_meta = array_map('reset', $term_meta);
240
- $term_meta = array_merge(array('orderby' => 'ID', 'order' => 'DESC'), $term_meta);
241
- $gmediaTerms[$i]->meta = $term_meta;
242
- $gmediaTerms[$i]->sharelink = str_replace(array('$1', '$2'), array($term->term_id, 'album'), $share_link);
243
- $gmediaTerms[$i]->cap = (4 == $cap)? 4 : 0;
 
 
 
 
 
 
 
244
  }
245
  $out['albums'] = array(
246
- 'cap' => $cap,
247
- 'data' => $gmediaTerms
248
  );
249
  }
250
- if(in_array('gmedia_tag', $data)){
251
- if($user_ID){
252
- $cap = (is_super_admin($user_ID) || user_can($user_ID, 'gmedia_tag_delete'))? 4 : (user_can($user_ID, 'gmedia_tag_edit')? 2 : 0);
253
- } else{
254
  $cap = 0;
255
  }
256
- $gmediaTerms = $gmDB->get_terms('gmedia_tag');
257
- foreach($gmediaTerms as $i => $term){
258
- unset($gmediaTerms[$i]->description, $gmediaTerms[$i]->global, $gmediaTerms[$i]->status);
259
- $gmediaTerms[$i]->sharelink = str_replace(array('$1', '$2'), array($term->term_id, 'tag'), $share_link);
260
- $gmediaTerms[$i]->cap = (4 == $cap)? 4 : 0;
261
  }
262
  $out['tags'] = array(
263
- 'cap' => $cap,
264
  'data' => $gmediaTerms
265
  );
266
  }
@@ -276,65 +291,68 @@ function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter',
276
  *
277
  * @return array
278
  */
279
- function gmedia_ios_app_processor($action, $data, $filter = true){
280
- global $gmCore, $gmDB, $gmGallery;
281
 
282
  $out = array();
283
 
284
  $error = array();
285
  $alert = array();
286
- $data = (array)$data;
287
- switch($action){
288
  case 'do_library':
289
 
290
- if(!current_user_can('edit_posts')){
291
- $out['error'] = array('code' => 'nocapability', 'title' => "You can't do this", 'message' => 'You have no permission to do this operation');
292
-
293
- return $out;
294
- }
295
-
296
- if(!isset($data['action'])){
297
  return $out;
298
  }
299
- switch($data['action']){
300
 
301
  case 'add_media':
302
- usleep(10);
 
 
 
 
303
 
304
- if(is_uploaded_file($_FILES['userfile']['tmp_name'])){
 
 
305
  $file_name = $_FILES['userfile']['name'];
306
- $file_tmp = $_FILES['userfile']['tmp_name'];
307
- } else{
308
- $error[] = __("Failed to move uploaded file.", 'gmLang');
309
  break;
310
  }
311
 
312
- $fileinfo = $gmCore->fileinfo($file_name);
 
 
 
313
 
314
- $gmedia = (array)$data['item'];
315
- if(!current_user_can('gmedia_terms')){
316
- unset($gmedia['categories'], $gmedia['albums'], $gmedia['tags']);
317
- } else{
318
- if(!empty($gmedia['categories'])){
319
- $cat = $gmedia['categories'][0]->name;
320
  $gmedia['terms']['gmedia_category'] = $cat;
321
  }
322
- if(empty($gmedia['albums'])){
323
  $gmedia['terms']['gmedia_album'] = '';
324
- } else{
325
- $alb = isset($gmedia['albums'][0]->term_id)? $gmedia['albums'][0]->term_id : $gmedia['albums'][0]->name;
326
  $gmedia['terms']['gmedia_album'] = $alb;
327
  }
328
- if(empty($gmedia['tags'])){
329
  $gmedia['terms']['gmedia_tag'] = '';
330
- } else{
331
  $tags = array();
332
- foreach($gmedia['tags'] as $tag){
333
- $tags[] = isset($tag->term_id)? $tag->term_id : $tag->name;
334
  }
335
- $gmedia['terms']['gmedia_tag'] = implode(',', $tags);
336
  }
337
- unset($gmedia['categories'], $gmedia['albums'], $gmedia['tags']);
338
  }
339
  /*if(isset($gmedia['terms'])){
340
  $post_data = array('terms' => $gmedia['terms']);
@@ -342,424 +360,526 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
342
  $post_data = array();
343
  }*/
344
 
345
- $return = $gmCore->gmedia_upload_handler($file_tmp, $fileinfo, 'multipart', $gmedia);
346
- if(isset($return['error'])){
347
  $error[] = $return['error']['message'];
348
- } else{
349
  $alert[] = $return['success']['message'];
350
  }
351
  break;
352
 
353
  case 'update_media':
354
- if(!current_user_can('gmedia_edit_media')){
355
- $error[] = __('You are not allowed to edit media', 'gmLang');
356
- break;
357
- }
358
- $gmedia = (array)$data['item'];
359
- if(!empty($gmedia['ID'])){
360
- $item = $gmDB->get_gmedia($gmedia['ID']);
361
- if((int)$item->author != get_current_user_id()){
362
- if(!current_user_can('gmedia_edit_others_media')){
363
- $error[] = __('You are not allowed to edit others media', 'gmLang');
364
- break;
365
- }
366
- }
367
 
368
- $gmedia['modified'] = current_time('mysql');
369
  $gmedia['mime_type'] = $item->mime_type;
370
- $gmedia['gmuid'] = $item->gmuid;
 
 
 
371
 
372
- if(!current_user_can('gmedia_terms')){
373
- unset($gmedia['categories'], $gmedia['albums'], $gmedia['tags']);
374
- } else{
375
- if(!empty($gmedia['categories'])){
376
- $cat = $gmedia['categories'][0]->name;
 
377
  $gmedia['terms']['gmedia_category'] = $cat;
378
  }
379
- if(empty($gmedia['albums'])){
380
  $gmedia['terms']['gmedia_album'] = '';
381
- } else{
382
- $alb = isset($gmedia['albums'][0]->term_id)? $gmedia['albums'][0]->term_id : $gmedia['albums'][0]->name;
383
- $gmedia['terms']['gmedia_album'] = $alb;
 
 
 
384
  }
385
- if(empty($gmedia['tags'])){
386
  $gmedia['terms']['gmedia_tag'] = '';
387
- } else{
388
  $tags = array();
389
- foreach($gmedia['tags'] as $tag){
390
- $tags[] = isset($tag->term_id)? $tag->term_id : $tag->name;
 
 
 
 
391
  }
392
- $gmedia['terms']['gmedia_tag'] = implode(',', $tags);
393
  }
394
- unset($gmedia['categories'], $gmedia['albums'], $gmedia['tags']);
395
  }
396
 
397
- $gmDB->insert_gmedia($gmedia);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  }
399
  break;
400
 
401
  case 'assign_category':
402
- if(!current_user_can('gmedia_terms')){
403
- $error[] = __('You are not allowed to manage categories', 'gmLang');
404
  break;
405
  }
406
  $term = $data['assign_category'][0];
407
- if(false === $term){
408
  break;
409
  }
410
- $count = count($data['selected']);
411
- if('0' == $term){
412
- foreach($data['selected'] as $item){
413
- $gmDB->delete_gmedia_term_relationships($item, 'gmedia_category');
414
  }
415
- $alert[] = sprintf(__('%d items updated with "Uncategorized"', 'gmLang'), $count);
416
- } else{
417
- foreach($data['selected'] as $item){
418
- $result = $gmDB->set_gmedia_terms($item, $term, 'gmedia_category', $append = 0);
419
- if(is_wp_error($result)){
420
- $error[] = $result;
421
- $count--;
422
- } elseif(!$result){
423
- $count--;
424
  }
425
  }
426
- if(isset($gmGallery->options['taxonomies']['gmedia_category'][$term])){
427
- $cat_name = $gmGallery->options['taxonomies']['gmedia_category'][$term];
428
- $alert[] = sprintf(__("Category `%s` assigned to %d images.", 'gmLang'), esc_html($cat_name), $count);
429
- } else{
430
- $error[] = sprintf(__("Category `%s` can't be assigned.", 'gmLang'), $term);
431
  }
432
  }
433
  break;
434
 
435
  case 'assign_album':
436
- if(!current_user_can('gmedia_terms')){
437
- $error[] = __('You are not allowed to manage albums', 'gmLang');
438
- }
439
- $term = $data['assign_album'][0];
440
- $count = count($data['selected']);
441
- if('0' == $term){
442
- foreach($data['selected'] as $item){
443
- $gmDB->delete_gmedia_term_relationships($item, 'gmedia_album');
444
  }
445
- $alert[] = sprintf(__('%d items updated with "No Album"', 'gmLang'), $count);
446
- } else{
447
- foreach($data['selected'] as $item){
448
- $result = $gmDB->set_gmedia_terms($item, $term, 'gmedia_album', $append = 0);
449
- if(is_wp_error($result)){
450
- $error[] = $result;
451
- $count--;
452
- } elseif(!$result){
453
- $count--;
454
  }
455
  }
456
- if($gmCore->is_digit($term)){
457
- $alb_name = $gmDB->get_alb_name($term);
458
- } else{
459
  $alb_name = $term;
460
  }
461
- $alert[] = sprintf(__('Album `%s` assigned to %d items', 'gmLang'), esc_html($alb_name), $count);
462
  }
463
  break;
464
 
465
  case 'add_tags':
466
- if(!current_user_can('gmedia_terms')){
467
- $error[] = __('You are not allowed manage tags', 'gmLang');
468
  break;
469
  }
470
- if(empty($data['add_tags'])){
471
- $error[] = __('No tags provided', 'gmLang');
472
  break;
473
  }
474
- $term = $data['add_tags'];
475
- $count = count($data['selected']);
476
- foreach($data['selected'] as $item){
477
- $result = $gmDB->set_gmedia_terms($item, $term, 'gmedia_tag', $append = 1);
478
- if(is_wp_error($result)){
479
- $error[] = $result;
480
- $count--;
481
- } elseif(!$result){
482
- $count--;
483
  }
484
  }
485
- $alert[] = sprintf(__('%d tags added to %d items', 'gmLang'), count($term), $count);
486
  break;
487
 
488
  case 'delete_tags':
489
- if(!current_user_can('gmedia_delete_others_media')){
490
- $error[] = __('You are not allowed to delete others media', 'gmLang');
491
  break;
492
  }
493
- if(empty($data['delete_tags'])){
494
- $error[] = __('No tags provided', 'gmLang');
495
  break;
496
  }
497
- $term = array_map('intval', $data['delete_tags']);
498
- $count = count($data['selected']);
499
- foreach($data['selected'] as $item){
500
- $result = $gmDB->set_gmedia_terms($item, $term, 'gmedia_tag', $append = -1);
501
- if(is_wp_error($result)){
502
- $error[] = $result;
503
- $count--;
504
- } elseif(!$result){
505
- $count--;
506
  }
507
  }
508
- $alert[] = sprintf(__('%d tags deleted from %d items', 'gmLang'), count($term), $count);
509
  break;
510
 
511
  case 'delete':
512
- global $user_ID;
513
- if(!current_user_can('gmedia_delete_media')){
514
- $error[] = __('You are not allowed to delete this post.');
515
  break;
516
  }
517
- $count = count($data['selected']);
518
- foreach($data['selected'] as $item){
519
- $gm_item = $gmDB->get_gmedia($item);
520
- if(((int)$gm_item->author != $user_ID) && !current_user_can('gmedia_delete_others_media')){
521
- $error[] = "#{$item}: " . __('You are not allowed to delete media others media', 'gmLang');
522
  continue;
523
  }
524
- if(!$gmDB->delete_gmedia((int)$item)){
525
- $error[] = "#{$item}: " . __('Error in deleting...', 'gmLang');
526
- $count--;
527
  }
528
  }
529
- if($count){
530
- $alert[] = sprintf(__('%d items deleted successfuly', 'gmLang'), $count);
531
  }
532
  break;
533
  }
534
 
535
- $filter = gmedia_ios_app_library_data(array('filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag'));
536
- $out = array_merge($out, $filter);
537
  break;
538
 
539
  case 'library':
540
- if(get_option('permalink_structure')){
541
- $ep = $gmGallery->options['endpoint'];
542
- $share_link = home_url($ep . '/single/');
543
- } else{
544
- $share_link = home_url('index.php?type=single&gmedia=');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
  }
546
- $filter = $filter? gmedia_ios_app_library_data(array('filter')) : array();
547
- if(!is_user_logged_in()){
548
- $data['status'] = array('public');
549
- }
550
- $gmedias = $gmDB->get_gmedias($data);
551
- foreach($gmedias as $i => $item){
552
-
553
- $author_id = $item->author;
554
- $authordata = get_userdata( $author_id );
555
- $display_name = $authordata->display_name;
556
- $first_name = $authordata->first_name;
557
- $last_name = $authordata->last_name;
558
- $gmedias[$i]->user = array('id' => $author_id, 'displayname' => $display_name, 'firstname' => $first_name, 'last_name' => $last_name);
559
-
560
- $meta = $gmDB->get_metadata('gmedia', $item->ID);
561
- $_metadata = maybe_unserialize($meta['_metadata'][0]);
562
- $type = explode('/', $item->mime_type);
563
- $item_url = $gmCore->upload['url'] . '/' . $gmGallery->options['folder'][$type[0]] . '/' . $item->gmuid;
564
- $gmedias[$i]->url = $item_url;
565
- $terms = $gmDB->get_the_gmedia_terms($item->ID, 'gmedia_tag');
566
- $tags = array();
567
- if($terms){
568
- $terms = array_values((array)$terms);
569
- foreach($terms as $term){
570
- $tags[] = array('term_id' => $term->term_id, 'name' => $term->name);
 
 
 
 
571
  }
572
  }
573
- $gmedias[$i]->tags = $tags;
574
 
575
- $terms = $gmDB->get_the_gmedia_terms($item->ID, 'gmedia_album');
576
  $albums = array();
577
- if($terms){
578
- $terms = array_values((array)$terms);
579
- foreach($terms as $term){
580
- $albums[] = array('term_id' => $term->term_id, 'name' => $term->name, 'status' => $term->status);
581
  }
582
  }
583
- $gmedias[$i]->albums = $albums;
584
 
585
- if('image' == $type[0]){
586
- $terms = $gmDB->get_the_gmedia_terms($item->ID, 'gmedia_category');
587
  $categories = array();
588
- if($terms){
589
- $terms = array_values((array)$terms);
590
- foreach($terms as $term){
591
- $categories[] = array('term_id' => $term->term_id, 'name' => $term->name);
592
  }
593
  }
594
- $gmedias[$i]->categories = $categories;
595
 
596
- $gmedias[$i]->meta = array(
597
- 'thumb' => $_metadata['thumb'],
598
- 'web' => $_metadata['web'],
599
  'original' => $_metadata['original']
600
  );
601
- $gmedias[$i]->meta['thumb']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_thumb']}/{$item->gmuid}";
602
- $gmedias[$i]->meta['web']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image']}/{$item->gmuid}";
603
- $gmedias[$i]->meta['original']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_original']}/{$item->gmuid}";
604
- $gmedias[$i]->meta['views'] = 0;
605
- $gmedias[$i]->meta['likes'] = 0;
606
- if(isset($meta['views'][0])){
607
- $gmedias[$i]->meta['views'] = $meta['views'][0];
608
- }
609
- if(isset($meta['likes'][0])){
610
- $gmedias[$i]->meta['likes'] = $meta['likes'][0];
611
- }
612
- if(isset($_metadata['image_info'])){
613
- $gmedias[$i]->meta['data'] = $_metadata['image_info'];
614
- }
615
- } else{
616
- $gmedias[$i]->meta = array(
617
  'thumb' => array(
618
- 'link' => $gmCore->gm_get_media_image($item, 'thumb'),
619
- 'width' => 300,
620
  'height' => 300
621
  )
622
  );
623
- if(!empty($_metadata)){
624
- $gmedias[$i]->meta['data'] = $_metadata;
625
  }
626
  }
627
- if(isset($meta['rating'][0])){
628
- $gmedias[$i]->meta['rating'] = maybe_unserialize($meta['rating'][0]);
629
  }
630
- $gmedias[$i]->sharelink = $share_link . $item->ID;
631
  }
632
- $out = array_merge($filter, array(
633
  'properties' => array(
634
- 'request' => isset($data['request'])? $data['request'] : null,
635
- 'total_pages' => $gmDB->pages,
636
  'current_page' => $gmDB->openPage,
637
- 'items_count' => $gmDB->gmediaCount
638
  ),
639
- 'data' => $gmedias
640
- ));
641
  break;
642
  case 'delete_term':
643
  $taxonomy = $data['taxonomy'];
644
- if(!empty($data['items'])){
645
- if(!current_user_can('delete_posts')){
646
- $error[] = __('You are not allowed to delete this post.');
647
  break;
648
  }
649
- $count = count($data['items']);
650
- foreach($data['items'] as $item){
651
- $delete = $gmDB->delete_term($item, $taxonomy);
652
- if(is_wp_error($delete)){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
653
  $error[] = $delete->get_error_message();
654
- $count--;
655
  }
656
  }
657
- if($count){
658
- $alert[] = sprintf(__('%d items deleted successfuly', 'gmLang'), $count);
659
  }
660
  }
661
- $out = gmedia_ios_app_library_data(array('filter', $taxonomy));
662
  break;
663
  case 'add_term':
664
- if(!current_user_can('edit_posts')){
665
- $out['error'] = array('code' => 'nocapability', 'title' => "You can't do this", 'message' => 'You have no permission to do this operation');
666
-
667
- return $out;
668
- }
669
- $taxonomy = $data['taxonomy'];
670
- $edit_term = isset($data['term_id'])? (int)$data['term_id'] : 0;
671
- $term = $data;
672
- if('gmedia_album' == $taxonomy){
673
- do{
674
- $term['name'] = trim($term['name']);
675
- if(empty($term['name'])){
676
- $error[] = __('Term Name is not specified', 'gmLang');
677
  break;
678
  }
679
- if($gmCore->is_digit($term['name'])){
680
- $error[] = __("Term Name can't be only digits", 'gmLang');
681
  break;
682
  }
683
- if($edit_term && !$gmDB->term_exists($edit_term, $taxonomy)){
684
- $error[] = __('A term with the id provided do not exists', 'gmLang');
685
  $edit_term = false;
686
  }
687
- if(($term_id = $gmDB->term_exists($term['name'], $taxonomy))){
688
- if($term_id != $edit_term){
689
- $error[] = __('A term with the name provided already exists', 'gmLang');
690
  break;
691
  }
692
  }
693
- if($edit_term){
694
- $term_id = $gmDB->update_term($edit_term, $taxonomy, $term);
695
- } else{
696
- $term_id = $gmDB->insert_term($term['name'], $taxonomy, $term);
 
 
 
 
 
 
 
 
697
  }
698
- if(is_wp_error($term_id)){
699
  $error[] = $term_id->get_error_message();
700
  break;
701
  }
702
 
703
  $term_meta = array(
704
  'orderby' => $term['orderby'],
705
- 'order' => $term['order']
706
  );
707
- foreach($term_meta as $key => $value){
708
- if($edit_term){
709
- $gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
710
- } else{
711
- $gmDB->add_metadata('gmedia_term', $term_id, $key, $value);
712
  }
713
  }
714
 
715
- $alert[] = sprintf(__('Album `%s` successfuly saved', 'gmLang'), $term['name']);
716
 
717
- } while(0);
718
- $out = gmedia_ios_app_library_data(array('filter', $taxonomy));
719
- } elseif('gmedia_tag' == $taxonomy){
720
- if($edit_term){
721
- $term['name'] = trim($term['name']);
722
- $term['term_id'] = intval($term['term_id']);
723
- if($term['name'] && !$gmCore->is_digit($term['name'])){
724
- if(($term_id = $gmDB->term_exists($term['term_id'], $taxonomy))){
725
- if(!$gmDB->term_exists($term['name'], $taxonomy)){
726
- $term_id = $gmDB->update_term($term['term_id'], $taxonomy, $term);
727
- if(is_wp_error($term_id)){
 
 
 
 
 
 
 
 
 
728
  $error[] = $term_id->get_error_message();
729
- } else{
730
- $alert[] = sprintf(__("Tag %d successfuly updated", 'gmLang'), $term_id);
731
  }
732
- } else{
733
- $error[] = __('A term with the name provided already exists', 'gmLang');
734
  }
735
- } else{
736
- $error[] = __("A term with the id provided do not exists", 'gmLang');
737
  }
738
- } else{
739
- $error[] = __("Term name can't be only digits or empty", 'gmLang');
740
  }
741
- } else{
742
- $terms = array_filter(array_map('trim', explode(',', $term['name'])));
743
  $terms_added = 0;
744
- $terms_qty = count($terms);
745
- foreach($terms as $term_name){
746
- if($gmCore->is_digit($term_name)){
747
  continue;
748
  }
749
 
750
- if(!$gmDB->term_exists($term_name, $taxonomy)){
751
- $term_id = $gmDB->insert_term($term_name, $taxonomy);
752
- if(is_wp_error($term_id)){
753
  $error[] = $term_id->get_error_message();
754
- } else{
755
- $alert['tag_add'] = sprintf(__('%d of %d tags successfuly added', 'gmLang'), ++$terms_added, $terms_qty);
756
  }
757
- } else{
758
- $alert['tag_add'] = __('Some of provided tags are already exists', 'gmLang');
759
  }
760
  }
761
  }
762
- $out = gmedia_ios_app_library_data(array('filter', $taxonomy));
763
  }
764
 
765
  break;
@@ -767,11 +887,11 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
767
  break;
768
  }
769
 
770
- if(!empty($error)){
771
- $out['error'] = array('code' => $action, 'title' => 'ERROR', 'message' => implode("\n", $error));
772
  }
773
- if(!empty($alert)){
774
- $out['alert'] = array('title' => 'Success', 'message' => implode("\n", $alert));
775
  }
776
 
777
  return $out;
@@ -781,43 +901,43 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
781
  /**
782
  * @param $data
783
  */
784
- function gmedia_ios_app_counters($data){
785
  global $gmDB;
786
 
787
- $data = (array)$data;
788
- $items_counter = array();
789
- if(!empty($data['views'])) {
790
- foreach ($data['views'] as $gmID) {
791
- $items_counter[$gmID]['views'] = 1;
792
- }
793
- if (!empty($data['likes'])) {
794
- foreach ($data['likes'] as $gmID) {
795
- $items_counter[$gmID]['likes'] = 1;
796
- }
797
- }
798
- }
799
-
800
- if(!empty($items_counter)) {
801
- foreach($items_counter as $gmID => $counters){
802
- if (null === $gmDB->get_gmedia($gmID)) {
803
- continue;
804
- }
805
- $counters['views'] = $gmDB->get_metadata('gmedia', $gmID, 'views', true);
806
- $counters['views'] +=1;
807
- $gmDB->update_metadata('gmedia', $gmID, 'views', $counters['views']);
808
- if(isset($counters['likes'])) {
809
- $counters['likes'] = $gmDB->get_metadata('gmedia', $gmID, 'likes', true);
810
- $counters['likes'] +=1;
811
- $gmDB->update_metadata('gmedia', $gmID, 'likes', $counters['likes']);
812
- }
813
-
814
- }
815
- }
816
 
817
  }
818
 
819
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
820
- echo json_encode($out);
821
 
822
  /*if(isset($_GET['test'])){
823
  echo "\n\n".print_r($out, true);
2
  //ini_set('display_errors', '1');
3
  //ini_set('error_reporting', E_ALL);
4
 
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ die( 0 );
7
  //@require_once(dirname(__FILE__) . '/config.php');
8
  }
9
 
10
  global $wp;
11
+ $gmedia_app = isset( $_GET['gmedia-app'] ) ? $_GET['gmedia-app'] : ( isset( $wp->query_vars['gmedia-app'] ) ? $wp->query_vars['gmedia-app'] : false );
12
+ if ( ! $gmedia_app ) {
13
  die();
14
  }
15
 
16
  global $gmCore;
17
  $out = array();
18
 
19
+ if ( isset( $_FILES['userfile']['name'] ) ) {
20
+ $globaldata = isset( $_POST['account'] ) ? $_POST['account'] : false;
21
+ if ( $globaldata ) {
22
+ $globaldata = stripslashes( $globaldata );
23
  }
24
+ } else {
25
+ $globaldata = isset( $GLOBALS['HTTP_RAW_POST_DATA'] ) ? $GLOBALS['HTTP_RAW_POST_DATA'] : false;
26
  }
27
 
28
+ if ( $globaldata ) {
29
 
30
+ $json = json_decode( $globaldata );
31
 
32
+ require_once( dirname( __FILE__ ) . '/inc/json.auth.php' );
33
  global $gmAuth;
34
  $gmAuth = new Gmedia_JSON_API_Auth_Controller();
35
 
36
+ if ( isset( $json->counter ) ) {
37
+ gmedia_ios_app_counters( $json->counter );
38
+ }
39
+
40
+ if ( isset( $json->cookie ) && ! empty( $json->cookie ) ) {
41
+ $user_id = $gmAuth->validate_auth_cookie( $json->cookie );
42
+ if ( $user_id ) {
43
+ $user = wp_set_current_user( $user_id );
44
+ if ( isset( $json->add_term ) ) {
45
+ $out = gmedia_ios_app_processor( 'add_term', $json->add_term );
46
+ } elseif ( isset( $json->delete_term ) ) {
47
+ $out = gmedia_ios_app_processor( 'delete_term', $json->delete_term );
48
+ } elseif ( isset( $json->doLibrary ) ) {
49
+ $job = gmedia_ios_app_processor( 'do_library', $json->doLibrary );
50
+ $out = gmedia_ios_app_processor( 'library', $json->library, false );
51
+ $out = array_merge( $out, $job );
52
+ } elseif ( isset( $json->library ) ) {
53
+ $out = gmedia_ios_app_processor( 'library', $json->library );
54
  }
55
 
56
 
57
+ } else {
58
+ $out['error'] = array( 'code' => 'wrongcookie', 'message' => 'Not Valid User' );
59
  }
60
+ } elseif ( isset( $json->login ) ) {
61
+ $out = gmedia_ios_app_login( $json );
62
+ if ( ! isset( $out['error'] ) ) {
63
+ $user = wp_set_current_user( $out['user']['id'] );
64
+
65
+ $gmedia_capabilities_list = array(
66
+ 'gmedia_library',
67
+ 'gmedia_show_others_media',
68
+ 'gmedia_edit_media',
69
+ 'gmedia_edit_others_media',
70
+ 'gmedia_delete_media',
71
+ 'gmedia_delete_others_media',
72
+ 'gmedia_upload',
73
+ 'gmedia_terms',
74
+ 'gmedia_album_manage',
75
+ 'gmedia_tag_manage',
76
+ 'gmedia_terms_delete'
77
+ );
78
+ $gmedia_capabilities = array();
79
+ foreach ( $gmedia_capabilities_list as $cap ) {
80
+ $gmedia_capabilities[ $cap ] = current_user_can( $cap );
81
+ }
82
+
83
+ $out['user']['gmedia_capabilities'] = $gmedia_capabilities;
84
+
85
+ $data = gmedia_ios_app_library_data();
86
+ $out = $out + $data;
87
+ }
88
+ } else {
89
+ if ( isset( $json->library ) ) {
90
+ $out = gmedia_ios_app_processor( 'library', $json->library );
91
+ } else {
92
+ $out = gmedia_ios_app_library_data();
93
  }
 
 
 
 
 
 
94
  }
95
 
96
+ } elseif ( 'lostpassword' == $gmCore->_get( 'action' ) ) {
97
+ if ( function_exists( 'wp_lostpassword_url' ) ) {
98
  $url = wp_lostpassword_url();
99
+ } else {
100
+ $url = add_query_arg( 'action', 'lostpassword', wp_login_url() );
101
  }
102
+ wp_redirect( $url );
103
  exit;
104
  }
105
 
109
  *
110
  * @return array
111
  */
112
+ function gmedia_ios_app_login( $json ) {
113
  global $gmAuth;
114
 
115
+ do {
116
+ if ( empty( $json->login ) ) {
117
+ $out['error'] = array( 'code' => 'nologin', 'title' => 'No Login', 'message' => 'No Login' );
118
  break;
119
  }
120
+ if ( ! isset( $json->password ) || empty( $json->password ) ) {
121
+ $out['error'] = array( 'code' => 'nopassword', 'title' => 'No Password', 'message' => 'No Password' );
122
  break;
123
  }
124
+ if ( ! ( $uid = username_exists( $json->login ) ) ) {
125
+ $out['error'] = array( 'code' => 'nouser', 'title' => 'No User', 'message' => 'No User' );
126
  break;
127
  }
128
 
129
  $args = array(
130
  'username' => $json->login,
131
  'password' => $json->password,
132
+ 'nonce' => wp_create_nonce( 'auth_gmapp' )
133
  );
134
+ $out = $gmAuth->generate_auth_cookie( $args );
135
 
136
+ } while ( 0 );
137
 
138
  return $out;
139
  }
143
  *
144
  * @return array
145
  */
146
+ function gmedia_ios_app_library_data( $data = array( 'site', 'authors', 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag' ) ) {
147
  global $user_ID, $gmCore, $gmDB, $gmGallery;
148
 
149
  $out = array();
150
 
151
+ if ( get_option( 'permalink_structure' ) ) {
152
+ $ep = $gmGallery->options['endpoint'];
153
+ $share_link = home_url( $ep . '/$2/$1' );
154
+ } else {
155
+ $share_link = home_url( 'index.php?gmedia=$1&type=$2' );
156
  }
157
 
158
+ if ( in_array( 'site', $data ) ) {
159
  $out['site'] = array(
160
+ 'title' => get_bloginfo( 'name' ),
161
+ 'description' => get_bloginfo( 'description' )
162
  );
163
  }
164
+ if ( in_array( 'authors', $data ) ) {
165
  $out['authors'] = array(
166
  'data' => array()
167
  );
168
  //if(current_user_can('gmedia_show_others_media') || current_user_can('gmedia_edit_others_media')){
169
+ $authors = get_users( array( 'who' => 'authors', 'orderby' => 'display_name' ) );
170
+ if ( $authors ) {
171
+ foreach ( $authors as $author ) {
172
+ $out['authors']['data'][] = array( 'id' => $author->ID, 'displayname' => $author->display_name, 'firstname' => $author->first_name, 'lastname' => $author->last_name );
 
173
  }
174
+ }
175
  /*} else{
176
  $authordata = get_userdata( $user_ID );
177
  $display_name = $authordata->display_name;
180
  $out['authors']['data'][] = array('id' => $user_ID, 'displayname' => $display_name, 'firstname' => $first_name, 'lastname' => $last_name);
181
  }*/
182
  }
183
+ if ( in_array( 'filter', $data ) ) {
184
  $out['filter'] = $gmDB->count_gmedia();
185
+ $out['filter'] = array_map( 'intval', $out['filter'] );
186
  }
187
+ if ( in_array( 'gmedia_category', $data ) ) {
188
  /*
189
  if($user_ID){
190
  $cap = (is_super_admin($user_ID) || user_can($user_ID, 'gmedia_category_delete'))? 4 : (user_can($user_ID, 'gmedia_category_edit')? 2 : 0);
192
  $cap = 0;
193
  }
194
  */
195
+ $gmediaTerms = $gmDB->get_terms( 'gmedia_category', array( 'fields' => 'name=>all' ) );
196
+ $terms = array_merge( array( '0' => __( 'Uncategorized', 'gmLang' ) ), $gmGallery->options['taxonomies']['gmedia_category'] );
197
  $out['categories'] = array(
198
  'list' => $terms,
199
+ 'cap' => 0,
200
  'data' => array()
201
  );
202
+ if ( ! empty( $gmediaTerms ) ) {
203
+ foreach ( $gmediaTerms as $name => $term ) {
204
+ unset( $gmediaTerms[ $name ]->description, $gmediaTerms[ $name ]->global, $gmediaTerms[ $name ]->status );
205
+ $gmediaTerms[ $name ]->title = $terms[ $name ];
206
+ $gmediaTerms[ $name ]->sharelink = str_replace( array( '$1', '$2' ), array( $term->term_id, 'category' ), $share_link );
207
+ $gmediaTerms[ $name ]->cap = 0;
208
  }
209
 
210
+ $out['categories']['data'] = array_values( $gmediaTerms );
211
  }
212
  }
213
+ if ( in_array( 'gmedia_album', $data ) ) {
214
+ $args = array();
215
+ if ( $user_ID ) {
216
+ if( current_user_can('gmedia_delete_terms' ) ){
217
+ $cap = 4;
218
+ } elseif( current_user_can( 'gmedia_album_edit' ) ){
219
+ $cap = 2;
220
+ } else{
221
+ $cap = 0;
222
+ }
223
+ if( !current_user_can('gmedia_edit_others_media')){
224
+ $args['global'] = array( $user_ID, 0 );
225
+ }
226
+ } else {
227
+ $cap = 0;
228
+ $args = array( 'status' => 'public' );
229
  }
230
+ $gmediaTerms = $gmDB->get_terms( 'gmedia_album', $args );
231
+ foreach ( $gmediaTerms as $i => $term ) {
232
+ $author_id = (int) $term->global;
233
+ if ( $author_id ) {
234
+ if ( ( $author_id != $user_ID ) && ( 'draft' == $term->status ) && ! current_user_can( 'gmedia_edit_others_media' ) ) {
235
+ unset( $gmediaTerms[ $i ] );
236
+ continue;
237
+ }
238
+ $authordata = get_userdata( $author_id );
239
+ $display_name = $authordata->display_name;
240
+ $first_name = $authordata->first_name;
241
+ $last_name = $authordata->last_name;
242
+ } else {
243
+ $display_name = __( 'Shared', 'gmLang' );
244
+ $first_name = $last_name = '';
 
 
 
245
  }
246
+ $gmediaTerms[ $i ]->user = array( 'id' => $author_id, 'displayname' => $display_name, 'firstname' => $first_name, 'lastname' => $last_name );
247
+
248
+ if ( $term->count ) {
249
+ $args = array( 'no_found_rows' => true, 'per_page' => 1, 'album__in' => array( $term->term_id ) );
250
+ $termItems = $gmDB->get_gmedias( $args );
251
+ $gmediaTerms[ $i ]->thumbnail = $gmCore->gm_get_media_image( $termItems[0], 'thumb', false );
252
+ }
253
+ $term_meta = $gmDB->get_metadata( 'gmedia_term', $term->term_id );
254
+ $term_meta = array_map( 'reset', $term_meta );
255
+ $term_meta = array_merge( array( 'orderby' => 'ID', 'order' => 'DESC' ), $term_meta );
256
+ $gmediaTerms[ $i ]->meta = $term_meta;
257
+ $gmediaTerms[ $i ]->sharelink = str_replace( array( '$1', '$2' ), array( $term->term_id, 'album' ), $share_link );
258
+ $gmediaTerms[ $i ]->cap = ( 4 == $cap ) ? 4 : 0;
259
  }
260
  $out['albums'] = array(
261
+ 'cap' => $cap,
262
+ 'data' => array_values( $gmediaTerms )
263
  );
264
  }
265
+ if ( in_array( 'gmedia_tag', $data ) ) {
266
+ if ( $user_ID ) {
267
+ $cap = ( is_super_admin( $user_ID ) || user_can( $user_ID, 'gmedia_tag_delete' ) ) ? 4 : ( user_can( $user_ID, 'gmedia_tag_edit' ) ? 2 : 0 );
268
+ } else {
269
  $cap = 0;
270
  }
271
+ $gmediaTerms = $gmDB->get_terms( 'gmedia_tag' );
272
+ foreach ( $gmediaTerms as $i => $term ) {
273
+ unset( $gmediaTerms[ $i ]->description, $gmediaTerms[ $i ]->global, $gmediaTerms[ $i ]->status );
274
+ $gmediaTerms[ $i ]->sharelink = str_replace( array( '$1', '$2' ), array( $term->term_id, 'tag' ), $share_link );
275
+ $gmediaTerms[ $i ]->cap = ( 4 == $cap ) ? 4 : 0;
276
  }
277
  $out['tags'] = array(
278
+ 'cap' => $cap,
279
  'data' => $gmediaTerms
280
  );
281
  }
291
  *
292
  * @return array
293
  */
294
+ function gmedia_ios_app_processor( $action, $data, $filter = true ) {
295
+ global $gmCore, $gmDB, $gmGallery, $user_ID;
296
 
297
  $out = array();
298
 
299
  $error = array();
300
  $alert = array();
301
+ $data = (array) $data;
302
+ switch ( $action ) {
303
  case 'do_library':
304
 
305
+ if ( ! isset( $data['action'] ) ) {
 
 
 
 
 
 
306
  return $out;
307
  }
308
+ switch ( $data['action'] ) {
309
 
310
  case 'add_media':
311
+ if ( ! current_user_can( 'gmedia_upload' ) ) {
312
+ $out['error'] = array( 'code' => 'nocapability', 'title' => __( "You can't do this", 'gmLang' ), 'message' => __( 'You have no permission to do this operation', 'gmLang' ) );
313
+
314
+ return $out;
315
+ }
316
 
317
+ usleep( 10 );
318
+
319
+ if ( is_uploaded_file( $_FILES['userfile']['tmp_name'] ) ) {
320
  $file_name = $_FILES['userfile']['name'];
321
+ $file_tmp = $_FILES['userfile']['tmp_name'];
322
+ } else {
323
+ $error[] = __( "Failed to move uploaded file.", 'gmLang' );
324
  break;
325
  }
326
 
327
+ $fileinfo = $gmCore->fileinfo( $file_name );
328
+ if ( false === $fileinfo ) {
329
+ break;
330
+ }
331
 
332
+ $gmedia = (array) $data['item'];
333
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
334
+ unset( $gmedia['categories'], $gmedia['albums'], $gmedia['tags'] );
335
+ } else {
336
+ if ( ! empty( $gmedia['categories'] ) ) {
337
+ $cat = $gmedia['categories'][0]->name;
338
  $gmedia['terms']['gmedia_category'] = $cat;
339
  }
340
+ if ( empty( $gmedia['albums'] ) ) {
341
  $gmedia['terms']['gmedia_album'] = '';
342
+ } else {
343
+ $alb = isset( $gmedia['albums'][0]->term_id ) ? $gmedia['albums'][0]->term_id : $gmedia['albums'][0]->name;
344
  $gmedia['terms']['gmedia_album'] = $alb;
345
  }
346
+ if ( empty( $gmedia['tags'] ) ) {
347
  $gmedia['terms']['gmedia_tag'] = '';
348
+ } else {
349
  $tags = array();
350
+ foreach ( $gmedia['tags'] as $tag ) {
351
+ $tags[] = isset( $tag->term_id ) ? $tag->term_id : $tag->name;
352
  }
353
+ $gmedia['terms']['gmedia_tag'] = implode( ',', $tags );
354
  }
355
+ unset( $gmedia['categories'], $gmedia['albums'], $gmedia['tags'] );
356
  }
357
  /*if(isset($gmedia['terms'])){
358
  $post_data = array('terms' => $gmedia['terms']);
360
  $post_data = array();
361
  }*/
362
 
363
+ $return = $gmCore->gmedia_upload_handler( $file_tmp, $fileinfo, 'multipart', $gmedia );
364
+ if ( isset( $return['error'] ) ) {
365
  $error[] = $return['error']['message'];
366
+ } else {
367
  $alert[] = $return['success']['message'];
368
  }
369
  break;
370
 
371
  case 'update_media':
372
+ $gmedia = (array) $data['item'];
373
+ if ( ! empty( $gmedia['ID'] ) ) {
374
+ $item = $gmDB->get_gmedia( $gmedia['ID'] );
 
 
 
 
 
 
 
 
 
 
375
 
376
+ $gmedia['modified'] = current_time( 'mysql' );
377
  $gmedia['mime_type'] = $item->mime_type;
378
+ $gmedia['gmuid'] = $item->gmuid;
379
+ if ( ! current_user_can( 'gmedia_delete_others_media' ) ) {
380
+ $gmedia['author'] = $item->author;
381
+ }
382
 
383
+
384
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
385
+ unset( $gmedia['categories'], $gmedia['albums'], $gmedia['tags'] );
386
+ } else {
387
+ if ( ! empty( $gmedia['categories'] ) ) {
388
+ $cat = $gmedia['categories'][0]->name;
389
  $gmedia['terms']['gmedia_category'] = $cat;
390
  }
391
+ if ( empty( $gmedia['albums'] ) ) {
392
  $gmedia['terms']['gmedia_album'] = '';
393
+ } else {
394
+ if ( isset( $gmedia['albums'][0]->term_id ) ) {
395
+ $gmedia['terms']['gmedia_album'] = $gmedia['albums'][0]->term_id;
396
+ } elseif ( current_user_can( 'gmedia_album_manage' ) ) {
397
+ $gmedia['terms']['gmedia_album'] = $gmedia['albums'][0]->name;
398
+ }
399
  }
400
+ if ( empty( $gmedia['tags'] ) ) {
401
  $gmedia['terms']['gmedia_tag'] = '';
402
+ } else {
403
  $tags = array();
404
+ foreach ( $gmedia['tags'] as $tag ) {
405
+ if ( isset( $tag->term_id ) ) {
406
+ $tags[] = $tag->term_id;
407
+ } elseif ( current_user_can( 'gmedia_tag_manage' ) ) {
408
+ $tags[] = $tag->name;
409
+ }
410
  }
411
+ $gmedia['terms']['gmedia_tag'] = implode( ',', $tags );
412
  }
413
+ unset( $gmedia['categories'], $gmedia['albums'], $gmedia['tags'] );
414
  }
415
 
416
+ if ( (int) $item->author == get_current_user_id() ) {
417
+ if ( ! current_user_can( 'gmedia_edit_media' ) ) {
418
+ $alert[] = __( 'You are not allowed to edit media', 'gmLang' );
419
+ }
420
+ } else {
421
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
422
+ $alert[] = __( 'You are not allowed to edit others media', 'gmLang' );
423
+ }
424
+ }
425
+ if ( empty( $alert ) ) {
426
+ $gmDB->insert_gmedia( $gmedia );
427
+ } else {
428
+ if ( current_user_can( 'gmedia_terms' ) && count( $gmedia['terms'] ) ) {
429
+ foreach ( $gmedia['terms'] as $tax => $terms ) {
430
+ $result = $gmDB->set_gmedia_terms( $gmedia['ID'], $terms, $tax, $append = 0 );
431
+ if ( is_wp_error( $result ) ) {
432
+ $error[] = $result->get_error_message();
433
+ }
434
+ }
435
+ }
436
+ }
437
  }
438
  break;
439
 
440
  case 'assign_category':
441
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
442
+ $error[] = __( 'You are not allowed to manage categories', 'gmLang' );
443
  break;
444
  }
445
  $term = $data['assign_category'][0];
446
+ if ( false === $term ) {
447
  break;
448
  }
449
+ $count = count( $data['selected'] );
450
+ if ( '0' == $term ) {
451
+ foreach ( $data['selected'] as $item ) {
452
+ $gmDB->delete_gmedia_term_relationships( $item, 'gmedia_category' );
453
  }
454
+ $alert[] = sprintf( __( '%d items updated with "Uncategorized"', 'gmLang' ), $count );
455
+ } else {
456
+ foreach ( $data['selected'] as $item ) {
457
+ $result = $gmDB->set_gmedia_terms( $item, $term, 'gmedia_category', $append = 0 );
458
+ if ( is_wp_error( $result ) ) {
459
+ $error[] = $result->get_error_message();
460
+ $count --;
461
+ } elseif ( ! $result ) {
462
+ $count --;
463
  }
464
  }
465
+ if ( isset( $gmGallery->options['taxonomies']['gmedia_category'][ $term ] ) ) {
466
+ $cat_name = $gmGallery->options['taxonomies']['gmedia_category'][ $term ];
467
+ $alert[] = sprintf( __( "Category `%s` assigned to %d images.", 'gmLang' ), esc_html( $cat_name ), $count );
468
+ } else {
469
+ $error[] = sprintf( __( "Category `%s` can't be assigned.", 'gmLang' ), $term );
470
  }
471
  }
472
  break;
473
 
474
  case 'assign_album':
475
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
476
+ $error[] = __( 'You are not allowed to manage albums', 'gmLang' );
477
+ }
478
+ $term = $data['assign_album'][0];
479
+ $count = count( $data['selected'] );
480
+ if ( '0' == $term ) {
481
+ foreach ( $data['selected'] as $item ) {
482
+ $gmDB->delete_gmedia_term_relationships( $item, 'gmedia_album' );
483
  }
484
+ $alert[] = sprintf( __( '%d items updated with "No Album"', 'gmLang' ), $count );
485
+ } else {
486
+ foreach ( $data['selected'] as $item ) {
487
+ $result = $gmDB->set_gmedia_terms( $item, $term, 'gmedia_album', $append = 0 );
488
+ if ( is_wp_error( $result ) ) {
489
+ $error[] = $result->get_error_message();
490
+ $count --;
491
+ } elseif ( ! $result ) {
492
+ $count --;
493
  }
494
  }
495
+ if ( $gmCore->is_digit( $term ) ) {
496
+ $alb_name = $gmDB->get_alb_name( $term );
497
+ } else {
498
  $alb_name = $term;
499
  }
500
+ $alert[] = sprintf( __( 'Album `%s` assigned to %d items', 'gmLang' ), esc_html( $alb_name ), $count );
501
  }
502
  break;
503
 
504
  case 'add_tags':
505
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
506
+ $error[] = __( 'You are not allowed manage tags', 'gmLang' );
507
  break;
508
  }
509
+ if ( empty( $data['add_tags'] ) ) {
510
+ $error[] = __( 'No tags provided', 'gmLang' );
511
  break;
512
  }
513
+ $term = $data['add_tags'];
514
+ $count = count( $data['selected'] );
515
+ foreach ( $data['selected'] as $item ) {
516
+ $result = $gmDB->set_gmedia_terms( $item, $term, 'gmedia_tag', $append = 1 );
517
+ if ( is_wp_error( $result ) ) {
518
+ $error[] = $result->get_error_message();
519
+ $count --;
520
+ } elseif ( ! $result ) {
521
+ $count --;
522
  }
523
  }
524
+ $alert[] = sprintf( __( '%d tags added to %d items', 'gmLang' ), count( $term ), $count );
525
  break;
526
 
527
  case 'delete_tags':
528
+ if ( ! current_user_can( 'gmedia_delete_others_media' ) ) {
529
+ $error[] = __( 'You are not allowed to delete others media', 'gmLang' );
530
  break;
531
  }
532
+ if ( empty( $data['delete_tags'] ) ) {
533
+ $error[] = __( 'No tags provided', 'gmLang' );
534
  break;
535
  }
536
+ $term = array_map( 'intval', $data['delete_tags'] );
537
+ $count = count( $data['selected'] );
538
+ foreach ( $data['selected'] as $item ) {
539
+ $result = $gmDB->set_gmedia_terms( $item, $term, 'gmedia_tag', $append = - 1 );
540
+ if ( is_wp_error( $result ) ) {
541
+ $error[] = $result->get_error_message();
542
+ $count --;
543
+ } elseif ( ! $result ) {
544
+ $count --;
545
  }
546
  }
547
+ $alert[] = sprintf( __( '%d tags deleted from %d items', 'gmLang' ), count( $term ), $count );
548
  break;
549
 
550
  case 'delete':
551
+ if ( ! current_user_can( 'gmedia_delete_media' ) ) {
552
+ $error[] = __( 'You are not allowed to delete this post.' );
 
553
  break;
554
  }
555
+ $count = count( $data['selected'] );
556
+ foreach ( $data['selected'] as $item ) {
557
+ $gm_item = $gmDB->get_gmedia( $item );
558
+ if ( ( (int) $gm_item->author != $user_ID ) && ! current_user_can( 'gmedia_delete_others_media' ) ) {
559
+ $error[] = "#{$item}: " . __( 'You are not allowed to delete media others media', 'gmLang' );
560
  continue;
561
  }
562
+ if ( ! $gmDB->delete_gmedia( (int) $item ) ) {
563
+ $error[] = "#{$item}: " . __( 'Error in deleting...', 'gmLang' );
564
+ $count --;
565
  }
566
  }
567
+ if ( $count ) {
568
+ $alert[] = sprintf( __( '%d items deleted successfuly', 'gmLang' ), $count );
569
  }
570
  break;
571
  }
572
 
573
+ $filter = gmedia_ios_app_library_data( array( 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag' ) );
574
+ $out = array_merge( $out, $filter );
575
  break;
576
 
577
  case 'library':
578
+ if ( get_option( 'permalink_structure' ) ) {
579
+ $ep = $gmGallery->options['endpoint'];
580
+ $share_link = home_url( $ep . '/single/' );
581
+ } else {
582
+ $share_link = home_url( 'index.php?type=single&gmedia=' );
583
+ }
584
+ $filter = $filter ? gmedia_ios_app_library_data( array( 'filter' ) ) : array();
585
+
586
+ $args = array(
587
+ 'mime_type' => null,
588
+ 'orderby' => 'ID',
589
+ 'order' => 'DESC',
590
+ 'per_page' => 100,
591
+ 'page' => 1,
592
+ 'tag__in' => null,
593
+ 'category__in' => null,
594
+ 'album__in' => null,
595
+ 'author' => 0,
596
+ 'status' => null
597
+ );
598
+ $data = wp_parse_args( $data, $args );
599
+ $false_out = array_merge( $filter, array(
600
+ 'properties' => array(
601
+ 'request' => isset( $data['request'] ) ? $data['request'] : null
602
+ ),
603
+ 'data' => array()
604
+ ) );
605
+
606
+ $is_collection = ! ( empty( $data['album__in'] ) && empty( $data['tag__in'] ) && empty( $data['category__in'] ) );
607
+ $is_admin = isset( $data['admin'] ) ? intval( $data['admin'] ) : 0;
608
+ if ( ! is_user_logged_in() ) {
609
+ $data['status'] = array( 'public' );
610
+ if ( $is_collection ) {
611
+ if ( ! empty( $data['album__in'] ) ) {
612
+ $alb = $gmDB->get_term( (int) $data['album__in'][0], 'gmedia_album' );
613
+ if ( ! ( isset( $alb->status ) && ( 'public' == $alb->status ) ) ) {
614
+ $out = $false_out;
615
+ break;
616
+ }
617
+ }
618
+ } else {
619
+ $out = $false_out;
620
+ break;
621
+ }
622
+ } else {
623
+ if ( $is_admin && ! current_user_can( 'gmedia_library' ) ) {
624
+ $out = $false_out;
625
+ break;
626
+ }
627
+ if ( $is_admin && ! current_user_can( 'gmedia_show_others_media' ) ) {
628
+ $data['author'] = $user_ID;
629
+ }
630
  }
631
+
632
+ $gmedias = $gmDB->get_gmedias( $data );
633
+ foreach ( $gmedias as $i => $item ) {
634
+
635
+ if ( ! $is_admin && ( 'draft' == $item->status ) && ( (int) $user_ID != (int) $item->author ) ) {
636
+ //if (!current_user_can('gmedia_edit_others_media')){
637
+ unset( $gmedias[ $i ] );
638
+ continue;
639
+ //}
640
+ }
641
+
642
+ $author_id = $item->author;
643
+ $authordata = get_userdata( $author_id );
644
+ $display_name = $authordata->display_name;
645
+ $first_name = $authordata->first_name;
646
+ $last_name = $authordata->last_name;
647
+ $gmedias[ $i ]->user = array( 'id' => $author_id, 'displayname' => $display_name, 'firstname' => $first_name, 'last_name' => $last_name );
648
+
649
+ $meta = $gmDB->get_metadata( 'gmedia', $item->ID );
650
+ $_metadata = maybe_unserialize( $meta['_metadata'][0] );
651
+ $type = explode( '/', $item->mime_type );
652
+ $item_url = $gmCore->upload['url'] . '/' . $gmGallery->options['folder'][ $type[0] ] . '/' . $item->gmuid;
653
+ $gmedias[ $i ]->url = $item_url;
654
+ $terms = $gmDB->get_the_gmedia_terms( $item->ID, 'gmedia_tag' );
655
+ $tags = array();
656
+ if ( $terms ) {
657
+ $terms = array_values( (array) $terms );
658
+ foreach ( $terms as $term ) {
659
+ $tags[] = array( 'term_id' => $term->term_id, 'name' => $term->name );
660
  }
661
  }
662
+ $gmedias[ $i ]->tags = $tags;
663
 
664
+ $terms = $gmDB->get_the_gmedia_terms( $item->ID, 'gmedia_album' );
665
  $albums = array();
666
+ if ( $terms ) {
667
+ $terms = array_values( (array) $terms );
668
+ foreach ( $terms as $term ) {
669
+ $albums[] = array( 'term_id' => $term->term_id, 'name' => $term->name, 'status' => $term->status );
670
  }
671
  }
672
+ $gmedias[ $i ]->albums = $albums;
673
 
674
+ if ( 'image' == $type[0] ) {
675
+ $terms = $gmDB->get_the_gmedia_terms( $item->ID, 'gmedia_category' );
676
  $categories = array();
677
+ if ( $terms ) {
678
+ $terms = array_values( (array) $terms );
679
+ foreach ( $terms as $term ) {
680
+ $categories[] = array( 'term_id' => $term->term_id, 'name' => $term->name );
681
  }
682
  }
683
+ $gmedias[ $i ]->categories = $categories;
684
 
685
+ $gmedias[ $i ]->meta = array(
686
+ 'thumb' => $_metadata['thumb'],
687
+ 'web' => $_metadata['web'],
688
  'original' => $_metadata['original']
689
  );
690
+ $gmedias[ $i ]->meta['thumb']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_thumb']}/{$item->gmuid}";
691
+ $gmedias[ $i ]->meta['web']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image']}/{$item->gmuid}";
692
+ $gmedias[ $i ]->meta['original']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_original']}/{$item->gmuid}";
693
+ $gmedias[ $i ]->meta['views'] = 0;
694
+ $gmedias[ $i ]->meta['likes'] = 0;
695
+ if ( isset( $meta['views'][0] ) ) {
696
+ $gmedias[ $i ]->meta['views'] = $meta['views'][0];
697
+ }
698
+ if ( isset( $meta['likes'][0] ) ) {
699
+ $gmedias[ $i ]->meta['likes'] = $meta['likes'][0];
700
+ }
701
+ if ( isset( $_metadata['image_info'] ) ) {
702
+ $gmedias[ $i ]->meta['data'] = $_metadata['image_info'];
703
+ }
704
+ } else {
705
+ $gmedias[ $i ]->meta = array(
706
  'thumb' => array(
707
+ 'link' => $gmCore->gm_get_media_image( $item, 'thumb' ),
708
+ 'width' => 300,
709
  'height' => 300
710
  )
711
  );
712
+ if ( ! empty( $_metadata ) ) {
713
+ $gmedias[ $i ]->meta['data'] = $_metadata;
714
  }
715
  }
716
+ if ( isset( $meta['rating'][0] ) ) {
717
+ $gmedias[ $i ]->meta['rating'] = maybe_unserialize( $meta['rating'][0] );
718
  }
719
+ $gmedias[ $i ]->sharelink = $share_link . $item->ID;
720
  }
721
+ $out = array_merge( $filter, array(
722
  'properties' => array(
723
+ 'request' => isset( $data['request'] ) ? $data['request'] : null,
724
+ 'total_pages' => $gmDB->pages,
725
  'current_page' => $gmDB->openPage,
726
+ 'items_count' => $gmDB->gmediaCount
727
  ),
728
+ 'data' => array_values( $gmedias )
729
+ ) );
730
  break;
731
  case 'delete_term':
732
  $taxonomy = $data['taxonomy'];
733
+ if ( ! empty( $data['items'] ) ) {
734
+ if ( ! current_user_can( 'gmedia_terms_delete' ) ) {
735
+ $error[] = __( 'You have no permission to do this operation', 'gmLang' );
736
  break;
737
  }
738
+ $count = count( $data['items'] );
739
+ foreach ( $data['items'] as $item ) {
740
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
741
+ if ( 'gmedia_album' == $taxonomy ) {
742
+ $term = $gmDB->get_term( $item, $taxonomy );
743
+ if ( (int) $term->global != (int) $user_ID ) {
744
+ $error['delete_album'] = __( 'You are not allowed to edit others media', 'gmLang' );
745
+ $count --;
746
+ continue;
747
+ }
748
+ } else {
749
+ $error[] = __( 'You are not allowed to edit others media', 'gmLang' );
750
+ $count --;
751
+ continue;
752
+ }
753
+ }
754
+ $delete = $gmDB->delete_term( $item, $taxonomy );
755
+ if ( is_wp_error( $delete ) ) {
756
  $error[] = $delete->get_error_message();
757
+ $count --;
758
  }
759
  }
760
+ if ( $count ) {
761
+ $alert[] = sprintf( __( '%d items deleted successfuly', 'gmLang' ), $count );
762
  }
763
  }
764
+ $out = gmedia_ios_app_library_data( array( 'filter', $taxonomy ) );
765
  break;
766
  case 'add_term':
767
+ $taxonomy = $data['taxonomy'];
768
+ $edit_term = isset( $data['term_id'] ) ? (int) $data['term_id'] : 0;
769
+ $term = $data;
770
+ if ( 'gmedia_album' == $taxonomy ) {
771
+ if ( ! current_user_can( 'gmedia_album_manage' ) ) {
772
+ $out['error'] = array( 'code' => 'nocapability', 'title' => __( "You can't do this", 'gmLang' ), 'message' => __( 'You have no permission to do this operation', 'gmLang' ) );
773
+
774
+ return $out;
775
+ }
776
+ do {
777
+ $term['name'] = trim( $term['name'] );
778
+ if ( empty( $term['name'] ) ) {
779
+ $error[] = __( 'Term Name is not specified', 'gmLang' );
780
  break;
781
  }
782
+ if ( $gmCore->is_digit( $term['name'] ) ) {
783
+ $error[] = __( "Term Name can't be only digits", 'gmLang' );
784
  break;
785
  }
786
+ if ( $edit_term && ! $gmDB->term_exists( $edit_term, $taxonomy ) ) {
787
+ $error[] = __( 'A term with the id provided do not exists', 'gmLang' );
788
  $edit_term = false;
789
  }
790
+ if ( ( $term_id = $gmDB->term_exists( $term['name'], $taxonomy ) ) ) {
791
+ if ( $term_id != $edit_term ) {
792
+ $error[] = __( 'A term with the name provided already exists', 'gmLang' );
793
  break;
794
  }
795
  }
796
+ if ( $edit_term ) {
797
+ $_term = $gmDB->get_term( $edit_term, $taxonomy );
798
+ if ( ( (int) $_term->global != (int) $user_ID ) && ! current_user_can( 'gmedia_edit_others_media' ) ) {
799
+ $error[] = __( 'You are not allowed to edit others media', 'gmLang' );
800
+ break;
801
+ }
802
+ $term_id = $gmDB->update_term( $edit_term, $taxonomy, $term );
803
+ } else {
804
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
805
+ $term['global'] = intval( $user_ID );
806
+ }
807
+ $term_id = $gmDB->insert_term( $term['name'], $taxonomy, $term );
808
  }
809
+ if ( is_wp_error( $term_id ) ) {
810
  $error[] = $term_id->get_error_message();
811
  break;
812
  }
813
 
814
  $term_meta = array(
815
  'orderby' => $term['orderby'],
816
+ 'order' => $term['order']
817
  );
818
+ foreach ( $term_meta as $key => $value ) {
819
+ if ( $edit_term ) {
820
+ $gmDB->update_metadata( 'gmedia_term', $term_id, $key, $value );
821
+ } else {
822
+ $gmDB->add_metadata( 'gmedia_term', $term_id, $key, $value );
823
  }
824
  }
825
 
826
+ $alert[] = sprintf( __( 'Album `%s` successfuly saved', 'gmLang' ), $term['name'] );
827
 
828
+ } while ( 0 );
829
+ $out = gmedia_ios_app_library_data( array( 'filter', $taxonomy ) );
830
+ } elseif ( 'gmedia_tag' == $taxonomy ) {
831
+ if ( ! current_user_can( 'gmedia_tag_manage' ) ) {
832
+ $out['error'] = array( 'code' => 'nocapability', 'title' => __( "You can't do this", 'gmLang' ), 'message' => __( 'You have no permission to do this operation', 'gmLang' ) );
833
+
834
+ return $out;
835
+ }
836
+ if ( $edit_term ) {
837
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
838
+ $error[] = __( 'You are not allowed to edit others media', 'gmLang' );
839
+ break;
840
+ }
841
+ $term['name'] = trim( $term['name'] );
842
+ $term['term_id'] = intval( $term['term_id'] );
843
+ if ( $term['name'] && ! $gmCore->is_digit( $term['name'] ) ) {
844
+ if ( ( $term_id = $gmDB->term_exists( $term['term_id'], $taxonomy ) ) ) {
845
+ if ( ! $gmDB->term_exists( $term['name'], $taxonomy ) ) {
846
+ $term_id = $gmDB->update_term( $term['term_id'], $taxonomy, $term );
847
+ if ( is_wp_error( $term_id ) ) {
848
  $error[] = $term_id->get_error_message();
849
+ } else {
850
+ $alert[] = sprintf( __( "Tag %d successfuly updated", 'gmLang' ), $term_id );
851
  }
852
+ } else {
853
+ $error[] = __( 'A term with the name provided already exists', 'gmLang' );
854
  }
855
+ } else {
856
+ $error[] = __( "A term with the id provided do not exists", 'gmLang' );
857
  }
858
+ } else {
859
+ $error[] = __( "Term name can't be only digits or empty", 'gmLang' );
860
  }
861
+ } else {
862
+ $terms = array_filter( array_map( 'trim', explode( ',', $term['name'] ) ) );
863
  $terms_added = 0;
864
+ $terms_qty = count( $terms );
865
+ foreach ( $terms as $term_name ) {
866
+ if ( $gmCore->is_digit( $term_name ) ) {
867
  continue;
868
  }
869
 
870
+ if ( ! $gmDB->term_exists( $term_name, $taxonomy ) ) {
871
+ $term_id = $gmDB->insert_term( $term_name, $taxonomy );
872
+ if ( is_wp_error( $term_id ) ) {
873
  $error[] = $term_id->get_error_message();
874
+ } else {
875
+ $alert['tag_add'] = sprintf( __( '%d of %d tags successfuly added', 'gmLang' ), ++ $terms_added, $terms_qty );
876
  }
877
+ } else {
878
+ $alert['tag_add'] = __( 'Some of provided tags are already exists', 'gmLang' );
879
  }
880
  }
881
  }
882
+ $out = gmedia_ios_app_library_data( array( 'filter', $taxonomy ) );
883
  }
884
 
885
  break;
887
  break;
888
  }
889
 
890
+ if ( ! empty( $error ) ) {
891
+ $out['error'] = array( 'code' => $action, 'title' => 'ERROR', 'message' => implode( "\n", $error ) );
892
  }
893
+ if ( ! empty( $alert ) ) {
894
+ $out['alert'] = array( 'title' => 'Success', 'message' => implode( "\n", $alert ) );
895
  }
896
 
897
  return $out;
901
  /**
902
  * @param $data
903
  */
904
+ function gmedia_ios_app_counters( $data ) {
905
  global $gmDB;
906
 
907
+ $data = (array) $data;
908
+ $items_counter = array();
909
+ if ( ! empty( $data['views'] ) ) {
910
+ foreach ( $data['views'] as $gmID ) {
911
+ $items_counter[ $gmID ]['views'] = 1;
912
+ }
913
+ if ( ! empty( $data['likes'] ) ) {
914
+ foreach ( $data['likes'] as $gmID ) {
915
+ $items_counter[ $gmID ]['likes'] = 1;
916
+ }
917
+ }
918
+ }
919
+
920
+ if ( ! empty( $items_counter ) ) {
921
+ foreach ( $items_counter as $gmID => $counters ) {
922
+ if ( null === $gmDB->get_gmedia( $gmID ) ) {
923
+ continue;
924
+ }
925
+ $counters['views'] = $gmDB->get_metadata( 'gmedia', $gmID, 'views', true );
926
+ $counters['views'] += 1;
927
+ $gmDB->update_metadata( 'gmedia', $gmID, 'views', $counters['views'] );
928
+ if ( isset( $counters['likes'] ) ) {
929
+ $counters['likes'] = $gmDB->get_metadata( 'gmedia', $gmID, 'likes', true );
930
+ $counters['likes'] += 1;
931
+ $gmDB->update_metadata( 'gmedia', $gmID, 'likes', $counters['likes'] );
932
+ }
933
+
934
+ }
935
+ }
936
 
937
  }
938
 
939
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
940
+ echo json_encode( $out );
941
 
942
  /*if(isset($_GET['test'])){
943
  echo "\n\n".print_r($out, true);
admin/addmedia.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
3
- die('You are not allowed to call this page directly.');
4
  }
5
 
6
  /**
@@ -8,29 +8,29 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
8
  *
9
  * @return mixed content
10
  */
11
- function gmedia_AddMedia(){
12
  global $gmCore;
13
- $tab = $gmCore->_get('tab', 'upload');
14
- $extra_tools = (defined('GMEDIA_IFRAME') && GMEDIA_IFRAME)? false : true;
15
  ?>
16
  <div class="panel panel-default">
17
  <div class="panel-heading clearfix">
18
- <?php if($extra_tools){ ?>
19
  <div class="btn-toolbar pull-left">
20
  <div class="btn-group">
21
- <a class="btn btn<?php echo ($tab == 'upload')? '-primary active' : '-default'; ?>" href="<?php echo $gmCore->get_admin_url(array(), array('tab'));; ?>"><?php _e('Upload Files', 'gmLang'); ?></a>
22
- <?php if($gmCore->caps['gmedia_import']){ ?>
23
- <a class="btn btn<?php echo ($tab == 'import')? '-primary active' : '-default'; ?>" href="<?php echo $gmCore->get_admin_url(array('tab' => 'import')); ?>"><?php _e('Import', 'gmLang'); ?></a><?php } ?>
24
  </div>
25
  </div>
26
  <?php } ?>
27
  <div id="total-progress-info" class="progress pull-right">
28
  <?php $msg = '';
29
- if($tab == 'upload'){
30
- $msg = __('Add files to the upload queue and click the start button', 'gmLang');
31
  }
32
- if($tab == 'import'){
33
- $msg = __('Grab files from other sources', 'gmLang');
34
  }
35
  ?>
36
  <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0;">
@@ -42,103 +42,103 @@ function gmedia_AddMedia(){
42
  <div class="panel-body" id="gmedia-msg-panel"></div>
43
  <div class="container-fluid gmAddMedia">
44
  <?php
45
- if($tab == 'upload'){
46
  gmedia_upload_files();
47
  }
48
- if($tab == 'import'){
49
  gmedia_import();
50
  }
51
  ?>
52
- <?php wp_original_referer_field(true, 'previous'); ?>
53
  </div>
54
  </div>
55
  <?php
56
  }
57
 
58
 
59
- function gmedia_upload_files(){
60
  global $gmCore, $gmDB, $gmProcessor, $gmGallery, $user_ID;
61
 
62
- if(!$gmCore->caps['gmedia_upload']){
63
- _e('You do not have permissions to upload media', 'gmLang');
64
 
65
  return;
66
  }
67
 
68
- $maxupsize = wp_max_upload_size();
69
- $maxupsize = floor($maxupsize * 0.99);
70
- $maxupsize_mb = floor($maxupsize / 1024 / 1024);
71
 
72
  $gm_screen_options = $gmProcessor->user_options();
73
 
74
  ?>
75
  <form class="row" id="gmUpload" name="upload_form" method="POST" accept-charset="utf-8" onsubmit="return false;">
76
  <div class="col-md-4" id="uploader_multipart_params">
77
- <br/>
78
- <?php if('false' == $gm_screen_options['uploader_chunking'] || ('html4' == $gm_screen_options['uploader_runtime'])){ ?>
79
- <p class="clearfix text-right"><span class="label label-default"><?php echo __('Maximum file size', 'gmLang') . ": {$maxupsize_mb}Mb"; ?></span></p>
80
- <?php } else{ ?>
81
- <p class="clearfix text-right hidden">
82
- <span class="label label-default"><?php echo __('Maximum $_POST size', 'gmLang') . ": {$maxupsize_mb}Mb"; ?></span>
83
- <span class="label label-default"><?php echo __('Chunk size', 'gmLang') . ': ' . min($maxupsize_mb, $gm_screen_options['uploader_chunk_size']) . 'Mb'; ?></span>
84
- </p>
85
- <?php } ?>
86
 
87
- <div class="form-group">
88
- <label><?php _e('Title', 'gmLang'); ?></label>
89
- <select name="set_title" class="form-control input-sm">
90
- <option value="exif"><?php _e('EXIF or File Name', 'gmLang'); ?></option>
91
- <option value="filename"><?php _e('File Name', 'gmLang'); ?></option>
92
- <option value="empty"><?php _e('Empty', 'gmLang'); ?></option>
93
- </select>
94
- </div>
95
- <div class="form-group">
96
- <label><?php _e('Status', 'gmLang'); ?></label>
97
- <select name="set_status" class="form-control input-sm">
98
- <option value="inherit"><?php _e('Same as Album or Public', 'gmLang'); ?></option>
99
- <option value="public"><?php _e('Public', 'gmLang'); ?></option>
100
- <option value="private"><?php _e('Private', 'gmLang'); ?></option>
101
- <option value="draft"><?php _e('Draft', 'gmLang'); ?></option>
102
- </select>
103
- </div>
104
 
105
- <hr />
106
 
107
- <?php if($gmCore->caps['gmedia_terms']){ ?>
108
  <div class="form-group">
109
  <?php
110
  $term_type = 'gmedia_category';
111
- $gm_terms = $gmGallery->options['taxonomies'][$term_type];
112
 
113
  $terms_category = '';
114
- if(count($gm_terms)){
115
- foreach($gm_terms as $term_name => $term_title){
116
- $terms_category .= '<option value="' . $term_name . '">' . esc_html($term_title) . '</option>' . "\n";
117
  }
118
  }
119
  ?>
120
- <label><?php _e('Assign Category', 'gmLang'); ?>
121
- <small><?php _e('(for images only)') ?></small>
122
  </label>
123
  <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
124
- <option value=""><?php _e('Uncategorized', 'gmLang'); ?></option>
125
  <?php echo $terms_category; ?>
126
  </select>
127
  </div>
128
  <div class="form-group">
129
  <?php
130
  $term_type = 'gmedia_album';
131
- $gm_terms = $gmDB->get_terms($term_type, array('global' => array(0, $user_ID), 'orderby' => 'global_desc_name'));
132
 
133
  $terms_album = '';
134
- if(count($gm_terms)){
135
- foreach($gm_terms as $term){
136
- $terms_album .= '<option value="' . esc_attr($term->term_id) . '">' . esc_html($term->name) . ($term->global? '' : __(' (shared)', 'gmLang')) . ('public' == $term->status? '' : " [{$term->status}]") . '</option>' . "\n";
137
  }
138
  }
139
  ?>
140
- <label><?php _e('Add to Album', 'gmLang'); ?> </label>
141
- <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e('Album Name...', 'gmLang'); ?>">
142
  <option value=""></option>
143
  <?php echo $terms_album; ?>
144
  </select>
@@ -146,17 +146,17 @@ function gmedia_upload_files(){
146
  <div class="form-group">
147
  <?php
148
  $term_type = 'gmedia_tag';
149
- $gm_terms = $gmDB->get_terms($term_type, array('fields' => 'names'));
150
  ?>
151
- <label><?php _e('Add Tags', 'gmLang'); ?> </label>
152
- <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e('Add Tags...', 'gmLang'); ?>"/>
153
  </div>
154
- <?php } else{ ?>
155
- <p><?php _e('You are not allowed to assign terms', 'gmLang') ?></p>
156
  <?php } ?>
157
 
158
  <script type="text/javascript">
159
- jQuery(function($){
160
  <?php if($gmCore->caps['gmedia_terms']){ ?>
161
  $('#combobox_gmedia_album').selectize({
162
  <?php if($gmCore->caps['gmedia_album_manage']){ ?>
@@ -168,12 +168,12 @@ function gmedia_upload_files(){
168
  persist: false
169
  });
170
  var gm_terms = <?php echo json_encode($gm_terms); ?>;
171
- var items = gm_terms.map(function(x){
172
- return { item: x };
173
  });
174
  $('#combobox_gmedia_tag').selectize({
175
  <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
176
- create: function(input){
177
  return {
178
  item: input
179
  }
@@ -192,11 +192,11 @@ function gmedia_upload_files(){
192
  hideSelected: true
193
  });
194
  <?php } ?>
195
- $('#uploader_runtime select').change(function(){
196
- if('html4' == $(this).val()){
197
  $('#uploader_chunking').addClass('hide');
198
  $('#uploader_urlstream_upload').addClass('hide');
199
- } else{
200
  $('#uploader_chunking').removeClass('hide');
201
  $('#uploader_urlstream_upload').removeClass('hide');
202
  }
@@ -205,25 +205,25 @@ function gmedia_upload_files(){
205
  </script>
206
  </div>
207
  <div class="col-md-8" id="pluploadUploader">
208
- <p><?php _e("You browser doesn't have Flash or HTML5 support. Check also if page have no JavaScript errors.", 'gmLang'); ?></p>
209
  <?php
210
- $mime_types = get_allowed_mime_types($user_ID);
211
- $type_ext = array();
212
- $filters = array();
213
- foreach($mime_types as $ext => $mime){
214
- $type = strtok($mime, '/');
215
- $type_ext[$type][] = $ext;
216
  }
217
- foreach($type_ext as $filter => $ext){
218
  $filters[] = array(
219
- 'title' => $filter,
220
- 'extensions' => str_replace('|', ',', implode(',', $ext))
221
  );
222
  }
223
  ?>
224
  <script type="text/javascript">
225
  // Convert divs to queue widgets when the DOM is ready
226
- jQuery(function($){
227
  $("#pluploadUploader").plupload({
228
  <?php if('auto' != $gm_screen_options['uploader_runtime']){ ?>
229
  runtimes: '<?php echo $gm_screen_options['uploader_runtime']; ?>',
@@ -235,7 +235,7 @@ function gmedia_upload_files(){
235
  <?php } else{ ?>
236
  multipart: true,
237
  <?php } ?>
238
- multipart_params: { params: ''},
239
  <?php if('true' == $gm_screen_options['uploader_chunking'] && ('html4' != $gm_screen_options['uploader_runtime'])){ ?>
240
  max_file_size: '2000Mb',
241
  chunk_size: 200000<?php //echo min($maxupsize, $gm_screen_options['uploader_chunk_size']*1024*1024); ?>,
@@ -259,43 +259,43 @@ function gmedia_upload_files(){
259
  });
260
  var closebtn = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
261
  var uploader = $("#pluploadUploader").plupload('getUploader');
262
- uploader.bind('StateChanged', function(up){
263
- if(up.state == plupload.STARTED){
264
- up.settings.multipart_params = { params: jQuery('#uploader_multipart_params :input').serialize() };
265
  }
266
- console.log('[StateChanged]', up.state, up.settings.multipart_params);
267
  });
268
- uploader.bind('ChunkUploaded', function(up, file, info){
269
- console.log('[ChunkUploaded] File:', file, "Info:", info);
270
  var response = jQuery.parseJSON(info.response);
271
- if(response && response.error){
272
  up.stop();
273
  file.status = plupload.FAILED;
274
- jQuery('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gmedia-msg-panel');
275
- console.log(response.error);
276
  up.trigger('QueueChanged StateChanged');
277
  up.trigger('UploadProgress', file);
278
  up.start();
279
  }
280
  });
281
- uploader.bind('FileUploaded', function(up, file, info){
282
- console.log('[FileUploaded] File:', file, "Info:", info);
283
  var response = jQuery.parseJSON(info.response);
284
- if(response && response.error){
285
  file.status = plupload.FAILED;
286
  jQuery('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gmedia-msg-panel');
287
- console.log(response.error);
288
  }
289
  });
290
- uploader.bind('UploadProgress', function(up, file){
291
  var percent = uploader.total.percent;
292
  $('#total-progress-info .progress-bar').css('width', percent + "%").attr('aria-valuenow', percent);
293
  });
294
- uploader.bind('Error', function(up, args){
295
  console.log('[Error] ', args);
296
  jQuery('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + args.file.name + ':</strong> ' + args.message + ' ' + args.status).appendTo('#gmedia-msg-panel');
297
  });
298
- uploader.bind('UploadComplete', function(up, files){
299
  console.log('[UploadComplete]', files);
300
  $('#total-progress-info .progress-bar').css('width', '0').attr('aria-valuenow', '0');
301
  });
@@ -308,224 +308,224 @@ function gmedia_upload_files(){
308
  }
309
 
310
 
311
- function gmedia_import(){
312
  global $wpdb, $gmCore, $gmGallery, $gmDB, $user_ID;
313
 
314
- if(!$gmCore->caps['gmedia_import']){
315
- _e('You do not have permissions to import media', 'gmLang');
316
 
317
  return;
318
  }
319
 
320
- $gmediaURL = plugins_url(GMEDIA_FOLDER);
321
  ?>
322
  <form class="row" id="import_form" name="import_form" target="import_window" action="<?php echo $gmCore->gmedia_url; ?>/admin/import.php" method="POST" accept-charset="utf-8" style="padding:20px 0 10px;">
323
- <div class="col-md-4">
324
- <fieldset id="import_params" class="import-params">
325
- <?php wp_nonce_field('GmediaImport'); ?>
326
- <input type="hidden" id="import-action" name="import" value=""/>
327
 
328
- <?php if($gmCore->caps['gmedia_terms']){ ?>
329
- <div class="form-group">
330
- <?php
331
- $term_type = 'gmedia_category';
332
- $gm_terms = $gmGallery->options['taxonomies'][$term_type];
333
 
334
- $terms_category = '';
335
- if(count($gm_terms)){
336
- foreach($gm_terms as $term_name => $term_title){
337
- $terms_category .= '<option value="' . $term_name . '">' . esc_html($term_title) . '</option>' . "\n";
338
- }
339
  }
340
- ?>
341
- <label><?php _e('Assign Category', 'gmLang'); ?>
342
- <small><?php _e('(for images only)') ?></small>
343
- </label>
344
- <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
345
- <option value=""><?php _e('Uncategorized', 'gmLang'); ?></option>
346
- <?php echo $terms_category; ?>
347
- </select>
348
- </div>
349
- <div class="form-group">
350
- <?php
351
- $term_type = 'gmedia_album';
352
- $gm_terms = $gmDB->get_terms($term_type, array('global' => array(0, $user_ID), 'orderby' => 'global_desc_name'));
 
353
 
354
- $terms_album = '';
355
- if(count($gm_terms)){
356
- foreach($gm_terms as $term){
357
- $terms_album .= '<option value="' . esc_attr($term->term_id) . '">' . esc_html($term->name) . ($term->global? '' : __(' (shared)', 'gmLang')) . ('public' == $term->status? '' : " [{$term->status}]") . '</option>' . "\n";
358
- }
359
  }
360
- ?>
361
- <label><?php _e('Add to Album', 'gmLang'); ?> </label>
362
- <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e('Album Name...', 'gmLang'); ?>">
363
- <option value=""></option>
364
- <?php echo $terms_album; ?>
365
- </select>
366
- </div>
367
- <div class="form-group">
368
- <?php
369
- $term_type = 'gmedia_tag';
370
- $gm_terms = $gmDB->get_terms($term_type, array('fields' => 'names'));
371
- ?>
372
- <label><?php _e('Add Tags', 'gmLang'); ?> </label>
373
- <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e('Add Tags...', 'gmLang'); ?>"/>
374
- </div>
375
- <?php } else{ ?>
376
- <p><?php _e('You are not allowed to assign terms', 'gmLang') ?></p>
377
- <?php } ?>
378
- <script type="text/javascript">
379
- jQuery(function($){
380
- <?php if($gmCore->caps['gmedia_terms']){ ?>
381
- $('#combobox_gmedia_album').selectize({
382
- <?php if($gmCore->caps['gmedia_album_manage']){ ?>
383
- create: true,
384
- createOnBlur: true,
385
- <?php } else{ ?>
386
- create: false,
387
- <?php } ?>
388
- persist: false
389
- });
390
- var gm_terms = <?php echo json_encode($gm_terms); ?>;
391
- var items = gm_terms.map(function(x){
392
- return { item: x };
393
- });
394
- $('#combobox_gmedia_tag').selectize({
395
- <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
396
- create: function(input){
397
- return {
398
- item: input
399
- }
400
- },
401
- createOnBlur: true,
402
- <?php } else{ ?>
403
- create: false,
404
- <?php } ?>
405
- delimiter: ',',
406
- maxItems: null,
407
- openOnFocus: false,
408
- persist: false,
409
- options: items,
410
- labelField: 'item',
411
- valueField: 'item',
412
- hideSelected: true
413
- });
414
  <?php } ?>
 
415
  });
416
- </script>
417
- </fieldset>
418
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
 
420
- <div class="col-md-8 tabable">
421
- <ul class="nav nav-tabs" style="padding:0 10px;">
422
- <li class="active"><a href="#import_folder" data-toggle="tab"><?php _e('Import Server Folder', 'gmLang'); ?></a></li>
423
- <?php if(($import['flagallery'] = $wpdb->get_var("show tables like '{$wpdb->prefix}flag_gallery'"))){ ?>
424
- <li><a href="#import_flagallery" data-toggle="tab"><?php _e('FlAGallery plugin', 'gmLang'); ?></a></li>
425
- <?php
426
- }
427
- if(($import['nextgen'] = $wpdb->get_var("show tables like '{$wpdb->prefix}ngg_gallery'"))){
428
- ?>
429
- <li><a href="#import_nextgen" data-toggle="tab"><?php _e('NextGen plugin', 'gmLang'); ?></a></li>
430
- <?php } ?>
431
- </ul>
432
- <div class="tab-content">
433
- <fieldset id="import_folder" class="tab-pane active">
434
- <?php echo "<style type='text/css'>@import url('{$gmediaURL}/assets/jqueryFileTree/jqueryFileTree.css');</style>\n"; ?>
435
- <?php echo "<script type='text/javascript' src='{$gmediaURL}/assets/jqueryFileTree/jqueryFileTree.js'></script>\n"; ?>
436
- <input type="hidden" id="folderpath" name="path" value="/"/>
437
 
438
- <div class="tab-inside">
439
- <h5><?php _e('Sever folders') ?>:</h5>
440
 
441
- <div id="file_browser"></div>
442
- </div>
443
- <div class="tab-footer">
444
- <div class="checkbox pull-left"><label><input type="checkbox" name="delete_source" value="1"/> <?php _e('delete source files after importing') ?>
445
- </label></div>
446
- <button class="pull-right btn btn-info gmedia-import" type="button" name="import-folder"><?php _e('Import folder', 'gmLang'); ?></button>
447
- </div>
448
- <script type="text/javascript">
449
- /* <![CDATA[ */
450
- jQuery(document).ready(function(){
451
- jQuery("#file_browser").fileTree({
452
- script: ajaxurl + "?action=gmedia_ftp_browser&_ajax_nonce=<?php echo wp_create_nonce( 'grandMedia' ) ;?>",
453
- root: '/',
454
- loadMessage: "<?php _e('loading...', 'gmLang'); ?>"
455
- }, function(path){
456
- jQuery("#folderpath").val(path);
457
- });
458
  });
459
- /* ]]> */
460
- </script>
461
- </fieldset>
 
462
 
463
- <?php if(!empty($import['flagallery'])){ ?>
464
- <fieldset id="import_flagallery" class="tab-pane">
465
- <?php
466
- $import['flagallery'] = $wpdb->get_results("SELECT gid, title, galdesc FROM `{$wpdb->prefix}flag_gallery`");
467
- if(!empty($import['flagallery'])){
468
- ?>
469
- <div class="tab-inside">
470
- <p><?php _e('If Album is not specified, then gallery name will be used as Album') ?></p>
471
- <h5><?php _e('Flagallery Galleries') ?>:
472
- <small>(<a href="#toggle-flaggalery" class="gm-toggle-cb"><?php _e('Toggle checkboxes', 'gmLang') ?></a>)</small>
473
- </h5>
474
- <div id="toggle-flaggalery">
475
- <?php foreach($import['flagallery'] as $gallery){ ?>
476
- <div class="checkbox">
477
- <label><input type="checkbox" name="gallery[]" value="<?php echo $gallery->gid ?>"/> <span><?php echo esc_html($gallery->title); ?></span></label>
478
- <?php /* if(!empty($gallery->galdesc)){
479
  echo '<div class="help-block"> ' . stripslashes($gallery->galdesc) . '</div>';
480
  } */
481
- ?>
482
- </div>
483
- <?php } ?>
484
- </div>
485
- </div>
486
- <div class="tab-footer">
487
- <button class="pull-right btn btn-info gmedia-import" type="button" name="import-flagallery"><?php _e('Import', 'gmLang'); ?></button>
488
  </div>
489
- <?php } else{ ?>
490
- <p class="tab-inside"><?php _e('There are no created galleries in this plugin.', 'gmLang') ?></p>
491
- <?php } ?>
492
- </fieldset>
493
- <?php } ?>
 
 
 
 
494
 
495
- <?php if(!empty($import['nextgen'])){ ?>
496
- <fieldset id="import_nextgen" class="tab-pane">
497
- <?php
498
- $import['nextgen'] = $wpdb->get_results("SELECT gid, title, galdesc FROM `{$wpdb->prefix}ngg_gallery`");
499
- if(!empty($import['nextgen'])){
500
- ?>
501
- <div class="tab-inside">
502
- <p><?php _e('If Album is not specified, then gallery name will be used as Album') ?></p>
503
- <h5><?php _e('Flagallery Galleries') ?>:
504
- <small>(<a href="#toggle-nextgen" class="gm-toggle-cb"><?php _e('Toggle checkboxes', 'gmLang') ?></a>)</small>
505
- </h5>
506
- <div id="toggle-nextgen">
507
- <?php foreach($import['nextgen'] as $gallery){ ?>
508
- <div class="checkbox">
509
- <label><input type="checkbox" name="gallery[]" value="<?php echo $gallery->gid ?>"/> <span><?php echo esc_html($gallery->title); ?></span></label>
510
- <?php /* if(!empty($gallery->galdesc)){
511
  echo '<div class="help-block"> ' . stripslashes($gallery->galdesc) . '</div>';
512
  } */
513
- ?>
514
- </div>
515
- <?php } ?>
516
- </div>
517
  </div>
518
- <div class="tab-footer">
519
- <button class="pull-right btn btn-info gmedia-import" type="button" name="import-nextgen"><?php _e('Import', 'gmLang'); ?></button>
520
- </div>
521
- <?php } else{ ?>
522
- <p class="tab-inside"><?php _e('There are no created galleries in this plugin.', 'gmLang') ?></p>
523
- <?php } ?>
524
- </fieldset>
525
- <?php } ?>
526
- </div>
527
- <div class="clear"></div>
528
  </div>
 
 
529
  </form>
530
 
531
  <div class="modal fade gmedia-modal" id="importModal" tabindex="-1" role="dialog" aria-hidden="true">
@@ -533,20 +533,21 @@ function gmedia_import(){
533
  <div class="modal-content">
534
  <div class="modal-header">
535
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
536
- <h4 class="modal-title"><?php _e('Import'); ?></h4>
537
  </div>
538
  <div class="modal-body">
539
  <script type="text/javascript">
540
- function gmedia_import_done(){
541
- if(jQuery('#importModal').is(':visible')){
542
- jQuery('#import-done').button('complete').prop('disabled', false);
 
543
  }
544
  }
545
  </script>
546
  <iframe name="import_window" id="import_window" src="about:blank" width="100%" height="300" onload="gmedia_import_done()"></iframe>
547
  </div>
548
  <div class="modal-footer">
549
- <button type="button" id="import-done" class="btn btn-primary" data-dismiss="modal" data-complete-text="<?php _e('Close', 'gmLang'); ?>" disabled="disabled"><?php _e('Working...', 'gmLang'); ?></button>
550
  </div>
551
  </div>
552
  <!-- /.modal-content -->
1
  <?php
2
+ if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
  /**
8
  *
9
  * @return mixed content
10
  */
11
+ function gmedia_AddMedia() {
12
  global $gmCore;
13
+ $tab = $gmCore->_get( 'tab', 'upload' );
14
+ $extra_tools = ( defined( 'GMEDIA_IFRAME' ) && GMEDIA_IFRAME ) ? false : true;
15
  ?>
16
  <div class="panel panel-default">
17
  <div class="panel-heading clearfix">
18
+ <?php if ( $extra_tools ) { ?>
19
  <div class="btn-toolbar pull-left">
20
  <div class="btn-group">
21
+ <a class="btn btn<?php echo ( $tab == 'upload' ) ? '-primary active' : '-default'; ?>" href="<?php echo $gmCore->get_admin_url( array(), array( 'tab' ) );; ?>"><?php _e( 'Upload Files', 'gmLang' ); ?></a>
22
+ <?php if ( $gmCore->caps['gmedia_import'] ) { ?>
23
+ <a class="btn btn<?php echo ( $tab == 'import' ) ? '-primary active' : '-default'; ?>" href="<?php echo $gmCore->get_admin_url( array( 'tab' => 'import' ) ); ?>"><?php _e( 'Import', 'gmLang' ); ?></a><?php } ?>
24
  </div>
25
  </div>
26
  <?php } ?>
27
  <div id="total-progress-info" class="progress pull-right">
28
  <?php $msg = '';
29
+ if ( $tab == 'upload' ) {
30
+ $msg = __( 'Add files to the upload queue and click the start button', 'gmLang' );
31
  }
32
+ if ( $tab == 'import' ) {
33
+ $msg = __( 'Grab files from other sources', 'gmLang' );
34
  }
35
  ?>
36
  <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0;">
42
  <div class="panel-body" id="gmedia-msg-panel"></div>
43
  <div class="container-fluid gmAddMedia">
44
  <?php
45
+ if ( $tab == 'upload' ) {
46
  gmedia_upload_files();
47
  }
48
+ if ( $tab == 'import' ) {
49
  gmedia_import();
50
  }
51
  ?>
52
+ <?php wp_original_referer_field( true, 'previous' ); ?>
53
  </div>
54
  </div>
55
  <?php
56
  }
57
 
58
 
59
+ function gmedia_upload_files() {
60
  global $gmCore, $gmDB, $gmProcessor, $gmGallery, $user_ID;
61
 
62
+ if ( ! $gmCore->caps['gmedia_upload'] ) {
63
+ _e( 'You do not have permissions to upload media', 'gmLang' );
64
 
65
  return;
66
  }
67
 
68
+ $maxupsize = wp_max_upload_size();
69
+ $maxupsize = floor( $maxupsize * 0.99 );
70
+ $maxupsize_mb = floor( $maxupsize / 1024 / 1024 );
71
 
72
  $gm_screen_options = $gmProcessor->user_options();
73
 
74
  ?>
75
  <form class="row" id="gmUpload" name="upload_form" method="POST" accept-charset="utf-8" onsubmit="return false;">
76
  <div class="col-md-4" id="uploader_multipart_params">
77
+ <br/>
78
+ <?php if ( 'false' == $gm_screen_options['uploader_chunking'] || ( 'html4' == $gm_screen_options['uploader_runtime'] ) ) { ?>
79
+ <p class="clearfix text-right"><span class="label label-default"><?php echo __( 'Maximum file size', 'gmLang' ) . ": {$maxupsize_mb}Mb"; ?></span></p>
80
+ <?php } else { ?>
81
+ <p class="clearfix text-right hidden">
82
+ <span class="label label-default"><?php echo __( 'Maximum $_POST size', 'gmLang' ) . ": {$maxupsize_mb}Mb"; ?></span>
83
+ <span class="label label-default"><?php echo __( 'Chunk size', 'gmLang' ) . ': ' . min( $maxupsize_mb, $gm_screen_options['uploader_chunk_size'] ) . 'Mb'; ?></span>
84
+ </p>
85
+ <?php } ?>
86
 
87
+ <div class="form-group">
88
+ <label><?php _e( 'Title', 'gmLang' ); ?></label>
89
+ <select name="set_title" class="form-control input-sm">
90
+ <option value="exif"><?php _e( 'EXIF or File Name', 'gmLang' ); ?></option>
91
+ <option value="filename"><?php _e( 'File Name', 'gmLang' ); ?></option>
92
+ <option value="empty"><?php _e( 'Empty', 'gmLang' ); ?></option>
93
+ </select>
94
+ </div>
95
+ <div class="form-group">
96
+ <label><?php _e( 'Status', 'gmLang' ); ?></label>
97
+ <select name="set_status" class="form-control input-sm">
98
+ <option value="inherit"><?php _e( 'Same as Album or Public', 'gmLang' ); ?></option>
99
+ <option value="public"><?php _e( 'Public', 'gmLang' ); ?></option>
100
+ <option value="private"><?php _e( 'Private', 'gmLang' ); ?></option>
101
+ <option value="draft"><?php _e( 'Draft', 'gmLang' ); ?></option>
102
+ </select>
103
+ </div>
104
 
105
+ <hr/>
106
 
107
+ <?php if ( $gmCore->caps['gmedia_terms'] ) { ?>
108
  <div class="form-group">
109
  <?php
110
  $term_type = 'gmedia_category';
111
+ $gm_terms = $gmGallery->options['taxonomies'][ $term_type ];
112
 
113
  $terms_category = '';
114
+ if ( count( $gm_terms ) ) {
115
+ foreach ( $gm_terms as $term_name => $term_title ) {
116
+ $terms_category .= '<option value="' . $term_name . '">' . esc_html( $term_title ) . '</option>' . "\n";
117
  }
118
  }
119
  ?>
120
+ <label><?php _e( 'Assign Category', 'gmLang' ); ?>
121
+ <small><?php _e( '(for images only)' ) ?></small>
122
  </label>
123
  <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
124
+ <option value=""><?php _e( 'Uncategorized', 'gmLang' ); ?></option>
125
  <?php echo $terms_category; ?>
126
  </select>
127
  </div>
128
  <div class="form-group">
129
  <?php
130
  $term_type = 'gmedia_album';
131
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'global' => array( 0, $user_ID ), 'orderby' => 'global_desc_name' ) );
132
 
133
  $terms_album = '';
134
+ if ( count( $gm_terms ) ) {
135
+ foreach ( $gm_terms as $term ) {
136
+ $terms_album .= '<option value="' . esc_attr( $term->term_id ) . '">' . esc_html( $term->name ) . ( $term->global ? '' : __( ' (shared)', 'gmLang' ) ) . ( 'public' == $term->status ? '' : " [{$term->status}]" ) . '</option>' . "\n";
137
  }
138
  }
139
  ?>
140
+ <label><?php _e( 'Add to Album', 'gmLang' ); ?> </label>
141
+ <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e( 'Album Name...', 'gmLang' ); ?>">
142
  <option value=""></option>
143
  <?php echo $terms_album; ?>
144
  </select>
146
  <div class="form-group">
147
  <?php
148
  $term_type = 'gmedia_tag';
149
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'fields' => 'names' ) );
150
  ?>
151
+ <label><?php _e( 'Add Tags', 'gmLang' ); ?> </label>
152
+ <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e( 'Add Tags...', 'gmLang' ); ?>"/>
153
  </div>
154
+ <?php } else { ?>
155
+ <p><?php _e( 'You are not allowed to assign terms', 'gmLang' ) ?></p>
156
  <?php } ?>
157
 
158
  <script type="text/javascript">
159
+ jQuery(function ($) {
160
  <?php if($gmCore->caps['gmedia_terms']){ ?>
161
  $('#combobox_gmedia_album').selectize({
162
  <?php if($gmCore->caps['gmedia_album_manage']){ ?>
168
  persist: false
169
  });
170
  var gm_terms = <?php echo json_encode($gm_terms); ?>;
171
+ var items = gm_terms.map(function (x) {
172
+ return {item: x};
173
  });
174
  $('#combobox_gmedia_tag').selectize({
175
  <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
176
+ create: function (input) {
177
  return {
178
  item: input
179
  }
192
  hideSelected: true
193
  });
194
  <?php } ?>
195
+ $('#uploader_runtime select').change(function () {
196
+ if ('html4' == $(this).val()) {
197
  $('#uploader_chunking').addClass('hide');
198
  $('#uploader_urlstream_upload').addClass('hide');
199
+ } else {
200
  $('#uploader_chunking').removeClass('hide');
201
  $('#uploader_urlstream_upload').removeClass('hide');
202
  }
205
  </script>
206
  </div>
207
  <div class="col-md-8" id="pluploadUploader">
208
+ <p><?php _e( "You browser doesn't have Flash or HTML5 support. Check also if page have no JavaScript errors.", 'gmLang' ); ?></p>
209
  <?php
210
+ $mime_types = get_allowed_mime_types( $user_ID );
211
+ $type_ext = array();
212
+ $filters = array();
213
+ foreach ( $mime_types as $ext => $mime ) {
214
+ $type = strtok( $mime, '/' );
215
+ $type_ext[ $type ][] = $ext;
216
  }
217
+ foreach ( $type_ext as $filter => $ext ) {
218
  $filters[] = array(
219
+ 'title' => $filter,
220
+ 'extensions' => str_replace( '|', ',', implode( ',', $ext ) )
221
  );
222
  }
223
  ?>
224
  <script type="text/javascript">
225
  // Convert divs to queue widgets when the DOM is ready
226
+ jQuery(function ($) {
227
  $("#pluploadUploader").plupload({
228
  <?php if('auto' != $gm_screen_options['uploader_runtime']){ ?>
229
  runtimes: '<?php echo $gm_screen_options['uploader_runtime']; ?>',
235
  <?php } else{ ?>
236
  multipart: true,
237
  <?php } ?>
238
+ multipart_params: {params: ''},
239
  <?php if('true' == $gm_screen_options['uploader_chunking'] && ('html4' != $gm_screen_options['uploader_runtime'])){ ?>
240
  max_file_size: '2000Mb',
241
  chunk_size: 200000<?php //echo min($maxupsize, $gm_screen_options['uploader_chunk_size']*1024*1024); ?>,
259
  });
260
  var closebtn = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
261
  var uploader = $("#pluploadUploader").plupload('getUploader');
262
+ uploader.bind('StateChanged', function (up) {
263
+ if (up.state == plupload.STARTED) {
264
+ up.settings.multipart_params = {params: jQuery('#uploader_multipart_params :input').serialize()};
265
  }
266
+ //console.log('[StateChanged]', up.state, up.settings.multipart_params);
267
  });
268
+ uploader.bind('ChunkUploaded', function (up, file, info) {
269
+ //console.log('[ChunkUploaded] File:', file, "Info:", info);
270
  var response = jQuery.parseJSON(info.response);
271
+ if (response && response.error) {
272
  up.stop();
273
  file.status = plupload.FAILED;
274
+ //jQuery('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gmedia-msg-panel');
275
+ console.log('[ChunkUploaded] ', response.error);
276
  up.trigger('QueueChanged StateChanged');
277
  up.trigger('UploadProgress', file);
278
  up.start();
279
  }
280
  });
281
+ uploader.bind('FileUploaded', function (up, file, info) {
282
+ //console.log('[FileUploaded] File:', file, "Info:", info);
283
  var response = jQuery.parseJSON(info.response);
284
+ if (response && response.error) {
285
  file.status = plupload.FAILED;
286
  jQuery('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gmedia-msg-panel');
287
+ console.log('[FileUploaded] ', response.error);
288
  }
289
  });
290
+ uploader.bind('UploadProgress', function (up, file) {
291
  var percent = uploader.total.percent;
292
  $('#total-progress-info .progress-bar').css('width', percent + "%").attr('aria-valuenow', percent);
293
  });
294
+ uploader.bind('Error', function (up, args) {
295
  console.log('[Error] ', args);
296
  jQuery('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + args.file.name + ':</strong> ' + args.message + ' ' + args.status).appendTo('#gmedia-msg-panel');
297
  });
298
+ uploader.bind('UploadComplete', function (up, files) {
299
  console.log('[UploadComplete]', files);
300
  $('#total-progress-info .progress-bar').css('width', '0').attr('aria-valuenow', '0');
301
  });
308
  }
309
 
310
 
311
+ function gmedia_import() {
312
  global $wpdb, $gmCore, $gmGallery, $gmDB, $user_ID;
313
 
314
+ if ( ! $gmCore->caps['gmedia_import'] ) {
315
+ _e( 'You do not have permissions to import media', 'gmLang' );
316
 
317
  return;
318
  }
319
 
320
+ $gmediaURL = plugins_url( GMEDIA_FOLDER );
321
  ?>
322
  <form class="row" id="import_form" name="import_form" target="import_window" action="<?php echo $gmCore->gmedia_url; ?>/admin/import.php" method="POST" accept-charset="utf-8" style="padding:20px 0 10px;">
323
+ <div class="col-md-4">
324
+ <fieldset id="import_params" class="import-params">
325
+ <?php wp_nonce_field( 'GmediaImport' ); ?>
326
+ <input type="hidden" id="import-action" name="import" value=""/>
327
 
328
+ <?php if ( $gmCore->caps['gmedia_terms'] ) { ?>
329
+ <div class="form-group">
330
+ <?php
331
+ $term_type = 'gmedia_category';
332
+ $gm_terms = $gmGallery->options['taxonomies'][ $term_type ];
333
 
334
+ $terms_category = '';
335
+ if ( count( $gm_terms ) ) {
336
+ foreach ( $gm_terms as $term_name => $term_title ) {
337
+ $terms_category .= '<option value="' . $term_name . '">' . esc_html( $term_title ) . '</option>' . "\n";
 
338
  }
339
+ }
340
+ ?>
341
+ <label><?php _e( 'Assign Category', 'gmLang' ); ?>
342
+ <small><?php _e( '(for images only)' ) ?></small>
343
+ </label>
344
+ <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
345
+ <option value=""><?php _e( 'Uncategorized', 'gmLang' ); ?></option>
346
+ <?php echo $terms_category; ?>
347
+ </select>
348
+ </div>
349
+ <div class="form-group">
350
+ <?php
351
+ $term_type = 'gmedia_album';
352
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'global' => array( 0, $user_ID ), 'orderby' => 'global_desc_name' ) );
353
 
354
+ $terms_album = '';
355
+ if ( count( $gm_terms ) ) {
356
+ foreach ( $gm_terms as $term ) {
357
+ $terms_album .= '<option value="' . esc_attr( $term->term_id ) . '">' . esc_html( $term->name ) . ( $term->global ? '' : __( ' (shared)', 'gmLang' ) ) . ( 'public' == $term->status ? '' : " [{$term->status}]" ) . '</option>' . "\n";
 
358
  }
359
+ }
360
+ ?>
361
+ <label><?php _e( 'Add to Album', 'gmLang' ); ?> </label>
362
+ <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e( 'Album Name...', 'gmLang' ); ?>">
363
+ <option value=""></option>
364
+ <?php echo $terms_album; ?>
365
+ </select>
366
+ </div>
367
+ <div class="form-group">
368
+ <?php
369
+ $term_type = 'gmedia_tag';
370
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'fields' => 'names' ) );
371
+ ?>
372
+ <label><?php _e( 'Add Tags', 'gmLang' ); ?> </label>
373
+ <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e( 'Add Tags...', 'gmLang' ); ?>"/>
374
+ </div>
375
+ <?php } else { ?>
376
+ <p><?php _e( 'You are not allowed to assign terms', 'gmLang' ) ?></p>
377
+ <?php } ?>
378
+ <script type="text/javascript">
379
+ jQuery(function ($) {
380
+ <?php if($gmCore->caps['gmedia_terms']){ ?>
381
+ $('#combobox_gmedia_album').selectize({
382
+ <?php if($gmCore->caps['gmedia_album_manage']){ ?>
383
+ create: true,
384
+ createOnBlur: true,
385
+ <?php } else{ ?>
386
+ create: false,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  <?php } ?>
388
+ persist: false
389
  });
390
+ var gm_terms = <?php echo json_encode($gm_terms); ?>;
391
+ var items = gm_terms.map(function (x) {
392
+ return {item: x};
393
+ });
394
+ $('#combobox_gmedia_tag').selectize({
395
+ <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
396
+ create: function (input) {
397
+ return {
398
+ item: input
399
+ }
400
+ },
401
+ createOnBlur: true,
402
+ <?php } else{ ?>
403
+ create: false,
404
+ <?php } ?>
405
+ delimiter: ',',
406
+ maxItems: null,
407
+ openOnFocus: false,
408
+ persist: false,
409
+ options: items,
410
+ labelField: 'item',
411
+ valueField: 'item',
412
+ hideSelected: true
413
+ });
414
+ <?php } ?>
415
+ });
416
+ </script>
417
+ </fieldset>
418
+ </div>
419
 
420
+ <div class="col-md-8 tabable">
421
+ <ul class="nav nav-tabs" style="padding:0 10px;">
422
+ <li class="active"><a href="#import_folder" data-toggle="tab"><?php _e( 'Import Server Folder', 'gmLang' ); ?></a></li>
423
+ <?php if ( ( $import['flagallery'] = $wpdb->get_var( "show tables like '{$wpdb->prefix}flag_gallery'" ) ) ) { ?>
424
+ <li><a href="#import_flagallery" data-toggle="tab"><?php _e( 'FlAGallery plugin', 'gmLang' ); ?></a></li>
425
+ <?php
426
+ }
427
+ if ( ( $import['nextgen'] = $wpdb->get_var( "show tables like '{$wpdb->prefix}ngg_gallery'" ) ) ) {
428
+ ?>
429
+ <li><a href="#import_nextgen" data-toggle="tab"><?php _e( 'NextGen plugin', 'gmLang' ); ?></a></li>
430
+ <?php } ?>
431
+ </ul>
432
+ <div class="tab-content">
433
+ <fieldset id="import_folder" class="tab-pane active">
434
+ <?php echo "<style type='text/css'>@import url('{$gmediaURL}/assets/jqueryFileTree/jqueryFileTree.css');</style>\n"; ?>
435
+ <?php echo "<script type='text/javascript' src='{$gmediaURL}/assets/jqueryFileTree/jqueryFileTree.js'></script>\n"; ?>
436
+ <input type="hidden" id="folderpath" name="path" value="/"/>
437
 
438
+ <div class="tab-inside">
439
+ <h5><?php _e( 'Sever folders' ) ?>:</h5>
440
 
441
+ <div id="file_browser"></div>
442
+ </div>
443
+ <div class="tab-footer">
444
+ <div class="checkbox pull-left"><label><input type="checkbox" name="delete_source" value="1"/> <?php _e( 'delete source files after importing' ) ?>
445
+ </label></div>
446
+ <button class="pull-right btn btn-info gmedia-import" type="button" name="import-folder"><?php _e( 'Import folder', 'gmLang' ); ?></button>
447
+ </div>
448
+ <script type="text/javascript">
449
+ /* <![CDATA[ */
450
+ jQuery(document).ready(function () {
451
+ jQuery("#file_browser").fileTree({
452
+ script: ajaxurl + "?action=gmedia_ftp_browser&_ajax_nonce=<?php echo wp_create_nonce( 'grandMedia' ) ;?>",
453
+ root: '/',
454
+ loadMessage: "<?php _e('loading...', 'gmLang'); ?>"
455
+ }, function (path) {
456
+ jQuery("#folderpath").val(path);
 
457
  });
458
+ });
459
+ /* ]]> */
460
+ </script>
461
+ </fieldset>
462
 
463
+ <?php if ( ! empty( $import['flagallery'] ) ) { ?>
464
+ <fieldset id="import_flagallery" class="tab-pane">
465
+ <?php
466
+ $import['flagallery'] = $wpdb->get_results( "SELECT gid, title, galdesc FROM `{$wpdb->prefix}flag_gallery`" );
467
+ if ( ! empty( $import['flagallery'] ) ) {
468
+ ?>
469
+ <div class="tab-inside">
470
+ <p><?php _e( 'If Album is not specified, then gallery name will be used as Album' ) ?></p>
471
+ <h5><?php _e( 'Flagallery Galleries' ) ?>:
472
+ <small>(<a href="#toggle-flaggalery" class="gm-toggle-cb"><?php _e( 'Toggle checkboxes', 'gmLang' ) ?></a>)</small>
473
+ </h5>
474
+ <div id="toggle-flaggalery">
475
+ <?php foreach ( $import['flagallery'] as $gallery ) { ?>
476
+ <div class="checkbox">
477
+ <label><input type="checkbox" name="gallery[]" value="<?php echo $gallery->gid ?>"/> <span><?php echo esc_html( $gallery->title ); ?></span></label>
478
+ <?php /* if(!empty($gallery->galdesc)){
479
  echo '<div class="help-block"> ' . stripslashes($gallery->galdesc) . '</div>';
480
  } */
481
+ ?>
482
+ </div>
483
+ <?php } ?>
 
 
 
 
484
  </div>
485
+ </div>
486
+ <div class="tab-footer">
487
+ <button class="pull-right btn btn-info gmedia-import" type="button" name="import-flagallery"><?php _e( 'Import', 'gmLang' ); ?></button>
488
+ </div>
489
+ <?php } else { ?>
490
+ <p class="tab-inside"><?php _e( 'There are no created galleries in this plugin.', 'gmLang' ) ?></p>
491
+ <?php } ?>
492
+ </fieldset>
493
+ <?php } ?>
494
 
495
+ <?php if ( ! empty( $import['nextgen'] ) ) { ?>
496
+ <fieldset id="import_nextgen" class="tab-pane">
497
+ <?php
498
+ $import['nextgen'] = $wpdb->get_results( "SELECT gid, title, galdesc FROM `{$wpdb->prefix}ngg_gallery`" );
499
+ if ( ! empty( $import['nextgen'] ) ) {
500
+ ?>
501
+ <div class="tab-inside">
502
+ <p><?php _e( 'If Album is not specified, then gallery name will be used as Album' ) ?></p>
503
+ <h5><?php _e( 'Flagallery Galleries' ) ?>:
504
+ <small>(<a href="#toggle-nextgen" class="gm-toggle-cb"><?php _e( 'Toggle checkboxes', 'gmLang' ) ?></a>)</small>
505
+ </h5>
506
+ <div id="toggle-nextgen">
507
+ <?php foreach ( $import['nextgen'] as $gallery ) { ?>
508
+ <div class="checkbox">
509
+ <label><input type="checkbox" name="gallery[]" value="<?php echo $gallery->gid ?>"/> <span><?php echo esc_html( $gallery->title ); ?></span></label>
510
+ <?php /* if(!empty($gallery->galdesc)){
511
  echo '<div class="help-block"> ' . stripslashes($gallery->galdesc) . '</div>';
512
  } */
513
+ ?>
514
+ </div>
515
+ <?php } ?>
 
516
  </div>
517
+ </div>
518
+ <div class="tab-footer">
519
+ <button class="pull-right btn btn-info gmedia-import" type="button" name="import-nextgen"><?php _e( 'Import', 'gmLang' ); ?></button>
520
+ </div>
521
+ <?php } else { ?>
522
+ <p class="tab-inside"><?php _e( 'There are no created galleries in this plugin.', 'gmLang' ) ?></p>
523
+ <?php } ?>
524
+ </fieldset>
525
+ <?php } ?>
 
526
  </div>
527
+ <div class="clear"></div>
528
+ </div>
529
  </form>
530
 
531
  <div class="modal fade gmedia-modal" id="importModal" tabindex="-1" role="dialog" aria-hidden="true">
533
  <div class="modal-content">
534
  <div class="modal-header">
535
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
536
+ <h4 class="modal-title"><?php _e( 'Import' ); ?></h4>
537
  </div>
538
  <div class="modal-body">
539
  <script type="text/javascript">
540
+ function gmedia_import_done() {
541
+ if (jQuery('#importModal').is(':visible')) {
542
+ var btn = jQuery('#import-done');
543
+ btn.text(btn.data('complete-text')).prop('disabled', false);
544
  }
545
  }
546
  </script>
547
  <iframe name="import_window" id="import_window" src="about:blank" width="100%" height="300" onload="gmedia_import_done()"></iframe>
548
  </div>
549
  <div class="modal-footer">
550
+ <button type="button" id="import-done" class="btn btn-primary" data-dismiss="modal" data-complete-text="<?php _e( 'Close', 'gmLang' ); ?>" disabled="disabled"><?php _e( 'Working...', 'gmLang' ); ?></button>
551
  </div>
552
  </div>
553
  <!-- /.modal-content -->
admin/admin.php CHANGED
@@ -4,26 +4,26 @@
4
  * GmediaAdmin - Admin Section for GRAND Media
5
  *
6
  */
7
- class GmediaAdmin{
8
  var $pages = array();
9
 
10
  /**
11
  * constructor
12
  */
13
- function __construct(){
14
  global $pagenow;
15
 
16
  // Add the admin menu
17
- add_action('admin_menu', array(&$this, 'add_menu'));
18
 
19
  // Add the script and style files
20
- add_action('admin_enqueue_scripts', array(&$this, 'load_scripts'));
21
 
22
- add_filter('screen_settings', array(&$this, 'screen_settings'), 10, 2);
23
- add_filter('set-screen-option', array(&$this, 'screen_settings_save'), 11, 3);
24
 
25
- if(('admin.php' == $pagenow) && isset($_GET['page']) && (false !== strpos($_GET['page'], 'GrandMedia')) && isset($_GET['gmediablank'])){
26
- add_action('admin_init', array(&$this, 'gmedia_blank_page'));
27
  }
28
 
29
  }
@@ -31,28 +31,28 @@ class GmediaAdmin{
31
  /**
32
  * Load gmedia pages in wpless interface
33
  */
34
- function gmedia_blank_page(){
35
- set_current_screen('GrandMedia_Settings');
36
 
37
  global $gmCore;
38
- $gmediablank = $gmCore->_get('gmediablank', '');
39
  /*
40
  add_filter('admin_body_class', function(){
41
  $gmediablank = isset($_GET['gmediablank'])? $_GET['gmediablank'] : '';
42
  return "gmedia-blank $gmediablank"; });
43
  */
44
- add_filter('admin_body_class', create_function('', '$gmediablank = isset($_GET["gmediablank"])? $_GET["gmediablank"] : ""; return "gmedia-blank $gmediablank";'));
45
- define('IFRAME_REQUEST', true);
46
 
47
- iframe_header('GmediaGallery');
48
 
49
- switch($gmediablank){
50
  case 'update_plugin':
51
- require_once(dirname(dirname(__FILE__)) . '/update.php');
52
  gmedia_do_update();
53
  break;
54
  case 'image_editor':
55
- require_once(dirname(dirname(__FILE__)) . '/inc/image-editor.php');
56
  gmedia_image_editor();
57
  break;
58
  }
@@ -64,51 +64,27 @@ class GmediaAdmin{
64
  /**
65
  * @return string
66
  */
67
- function gmedia_blank_page_body_class(){
68
  return 'gmedia-blank';
69
  }
70
 
71
  // integrate the menu
72
- function add_menu(){
73
- $gmediaURL = plugins_url(GMEDIA_FOLDER);
74
- $this->pages = array();
75
- $this->pages[] = add_object_page(__('Gmedia Library', 'gmLang'), 'Gmedia Gallery', 'gmedia_library', 'GrandMedia', array(
76
- &$this,
77
- 'shell'
78
- ), $gmediaURL . '/admin/images/gm-icon.png');
79
- $this->pages[] = add_submenu_page('GrandMedia', __('Gmedia Library', 'gmLang'), __('Gmedia Library', 'gmLang'), 'gmedia_library', 'GrandMedia', array(
80
- &$this,
81
- 'shell'
82
- ));
83
- if(current_user_can('gmedia_library')){
84
- $this->pages[] = add_submenu_page('GrandMedia', __('Add Media Files', 'gmLang'), __('Add/Import Files', 'gmLang'), 'gmedia_upload', 'GrandMedia_AddMedia', array(
85
- &$this,
86
- 'shell'
87
- ));
88
- $this->pages[] = add_submenu_page('GrandMedia', __('Albums, Tags...', 'gmLang'), __('Albums, Tags...', 'gmLang'), 'gmedia_library', 'GrandMedia_Terms', array(
89
- &$this,
90
- 'shell'
91
- ));
92
- $this->pages[] = add_submenu_page('GrandMedia', __('Gmedia Galleries', 'gmLang'), __('Create/Manage Galleries...', 'gmLang'), 'gmedia_gallery_manage', 'GrandMedia_Galleries', array(
93
- &$this,
94
- 'shell'
95
- ));
96
- $this->pages[] = add_submenu_page('GrandMedia', __('Modules', 'gmLang'), __('Modules', 'gmLang'), 'gmedia_gallery_manage', 'GrandMedia_Modules', array(
97
- &$this,
98
- 'shell'
99
- ));
100
- $this->pages[] = add_submenu_page('GrandMedia', __('Gmedia Settings', 'gmLang'), __('Settings', 'gmLang'), 'gmedia_settings', 'GrandMedia_Settings', array(
101
- &$this,
102
- 'shell'
103
- ));
104
- $this->pages[] = add_submenu_page('GrandMedia', __('Wordpress Media Library', 'gmLang'), __('WP Media Library', 'gmLang'), 'gmedia_import', 'GrandMedia_WordpressLibrary', array(
105
- &$this,
106
- 'shell'
107
- ));
108
  }
109
 
110
- foreach($this->pages as $page){
111
- add_action("load-$page", array(&$this, 'screen_help'));
112
  }
113
  }
114
 
@@ -116,23 +92,23 @@ class GmediaAdmin{
116
  * Load the script for the defined page and load only this code
117
  * Display shell of plugin
118
  */
119
- function shell(){
120
  global $gmProcessor;
121
 
122
  // check for upgrade
123
- if(get_option('gmediaDbVersion') != GMEDIA_DBVERSION){
124
- if(isset($_GET['do_update']) && ('gmedia' == $_GET['do_update'])){
125
- $update_frame = '<iframe name="gmedia_update" id="gmedia_update" width="100%" height="500" src="' . admin_url('admin.php?page=GrandMedia&gmediablank=update_plugin') . '"></iframe>';
126
  $gmProcessor->page = 'GrandMedia_Update';
127
- } else{
128
  return;
129
  }
130
  }
131
 
132
  $sideLinks = $this->sideLinks();
133
 
134
- if(isset($update_frame)){
135
- $sideLinks['grandTitle'] = __('Updating GmediaGallery Plugin', 'gmLang');
136
  }
137
  ?>
138
  <div id="gmedia-container">
@@ -142,24 +118,24 @@ class GmediaAdmin{
142
  </div>
143
  <h2><?php echo $sideLinks['grandTitle']; ?></h2>
144
  </div>
145
- <div id="gm-message"></div>
146
  <div class="container-fluid">
147
  <div class="row row-fx180-fl">
148
  <div class="col-sm-2 hidden-xs" id="sidebar" role="navigation">
149
  <?php echo $sideLinks['sideLinks']; ?>
150
  </div>
151
  <div class="col-sm-10 col-xs-12">
 
 
 
 
152
  <?php
153
- echo $gmProcessor->alert('success', $gmProcessor->msg);
154
- echo $gmProcessor->alert('danger', $gmProcessor->error);
155
-
156
- if(isset($update_frame)){
157
  ?>
158
  <div class="panel panel-default">
159
  <div class="panel-body"><?php echo $update_frame; ?></div>
160
  </div>
161
  <?php
162
- } else{
163
  $this->controller();
164
  }
165
  ?>
@@ -170,21 +146,21 @@ class GmediaAdmin{
170
  <?php
171
  }
172
 
173
- function sideLinks(){
174
  global $submenu, $gmProcessor;
175
  $content['sideLinks'] = '
176
  <div id="gmedia-navbar">
177
  <div class="row">
178
  <ul class="list-group">';
179
- foreach($submenu['GrandMedia'] as $menuKey => $menuItem){
180
- if($submenu['GrandMedia'][$menuKey][2] == $gmProcessor->page){
181
- $iscur = ' active';
182
- $content['grandTitle'] = $submenu['GrandMedia'][$menuKey][3];
183
- } else{
184
  $iscur = '';
185
  }
186
 
187
- $content['sideLinks'] .= "\n" . '<a class="list-group-item' . $iscur . '" href="' . admin_url('admin.php?page=' . $submenu['GrandMedia'][$menuKey][2]) . '">' . $submenu['GrandMedia'][$menuKey][0] . '</a>';
188
  }
189
  $content['sideLinks'] .= '
190
  </ul>
@@ -194,45 +170,45 @@ class GmediaAdmin{
194
  return $content;
195
  }
196
 
197
- function controller(){
198
 
199
  global $gmProcessor;
200
- switch($gmProcessor->page){
201
  case 'GrandMedia_AddMedia':
202
- include_once(dirname(__FILE__) . '/addmedia.php');
203
  gmedia_AddMedia();
204
  break;
205
  case 'GrandMedia_Terms':
206
- include_once(dirname(__FILE__) . '/terms.php');
207
- if(isset($_GET['edit_album'])){
208
  gmediaAlbumEdit();
209
- } else{
210
  gmediaTerms();
211
  }
212
  break;
213
  case 'GrandMedia_Galleries':
214
- include_once(dirname(__FILE__) . '/galleries.php');
215
- if(isset($_GET['gallery_module']) || isset($_GET['edit_gallery'])){
216
  gmediaGalleryEdit();
217
- } else{
218
  gmediaGalleries();
219
  }
220
  break;
221
  case 'GrandMedia_Modules':
222
- include_once(dirname(__FILE__) . '/modules.php');
223
  gmediaModules();
224
  break;
225
  case 'GrandMedia_Settings':
226
- include_once(dirname(__FILE__) . '/settings.php');
227
  gmSettings();
228
  break;
229
  case 'GrandMedia_WordpressLibrary':
230
- include_once(dirname(__FILE__) . '/wpmedia.php');
231
  grandWPMedia();
232
  break;
233
  case 'GrandMedia':
234
  default:
235
- include_once(dirname(__FILE__) . '/gmedia.php');
236
  gmediaLib();
237
  break;
238
  }
@@ -241,84 +217,97 @@ class GmediaAdmin{
241
  /**
242
  * @param $hook
243
  */
244
- function load_scripts($hook){
245
- global $gmCore, $gmProcessor;
246
 
247
  // no need to go on if it's not a plugin page
248
- if('admin.php' != $hook && strpos($gmCore->_get('page'), 'GrandMedia') === false){
249
  return;
250
  }
251
 
252
- wp_enqueue_style('gmedia-bootstrap');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  //wp_enqueue_style( 'gmedia-bootstrap-theme' );
254
- wp_enqueue_script('gmedia-bootstrap');
255
 
256
  //wp_enqueue_script( 'outside-events' );
257
 
258
- if(isset($_GET['page'])){
259
- switch($_GET['page']){
260
  case "GrandMedia" :
261
- if($gmCore->caps['gmedia_edit_media']){
262
- if($gmCore->_get('gmediablank') == 'image_editor'){
263
- wp_enqueue_script('camanjs', $gmCore->gmedia_url . '/assets/image-editor/camanjs/caman.full.min.js', array(), '4.1.1');
264
 
265
- wp_enqueue_style('nouislider', $gmCore->gmedia_url . '/assets/image-editor/js/jquery.nouislider.css', array('gmedia-bootstrap'), '6.1.0');
266
- wp_enqueue_script('nouislider', $gmCore->gmedia_url . '/assets/image-editor/js/jquery.nouislider.min.js', array('jquery'), '6.1.0');
267
 
268
- wp_enqueue_style('gmedia-image-editor', $gmCore->gmedia_url . '/assets/image-editor/style.css', array('gmedia-bootstrap'), '0.9.16', 'screen');
269
- wp_enqueue_script('gmedia-image-editor', $gmCore->gmedia_url . '/assets/image-editor/image-editor.js', array('jquery', 'camanjs'), '0.9.16');
270
  break;
271
  }
272
- if($gmProcessor->mode){
273
- wp_enqueue_script('alphanum', $gmCore->gmedia_url . '/assets/jq-plugins/jquery.alphanum.js', array('jquery'), '1.0.16');
274
-
275
- wp_enqueue_script('moment', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/moment.min.js', array('jquery'), '2.5.1');
276
- wp_enqueue_style('datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css', array('gmedia-bootstrap'), '2.1.32');
277
- wp_enqueue_script('datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js', array(
278
- 'jquery',
279
- 'moment',
280
- 'gmedia-bootstrap'
281
- ), '2.1.32');
282
  }
283
  }
284
- if($gmCore->caps['gmedia_terms']){
285
- wp_enqueue_style('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array('gmedia-bootstrap'), '0.8.5', 'screen');
286
- wp_enqueue_script('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array('jquery'), '0.8.5');
287
  }
288
  break;
289
  case "GrandMedia_WordpressLibrary" :
290
- if($gmCore->caps['gmedia_import']){
291
- wp_enqueue_style('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array('gmedia-bootstrap'), '0.8.5', 'screen');
292
- wp_enqueue_script('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array('jquery'), '0.8.5');
293
  }
294
  break;
295
  case "GrandMedia_Terms" :
296
- if($gmCore->_get('edit_album') && $gmCore->caps['gmedia_album_manage']){
297
- wp_enqueue_style('jquery-ui-smoothness', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css', array(), '1.10.2', 'screen');
298
- wp_enqueue_script('jquery-ui-full', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js', array(), '1.10.2');
299
 
300
- wp_enqueue_script('tinysort', $gmCore->gmedia_url . '/assets/jq-plugins/jquery.tinysort.js', array('jquery'), '1.5.6');
301
  }
302
 
303
  break;
304
  case "GrandMedia_AddMedia" :
305
- if($gmCore->caps['gmedia_terms']){
306
- wp_enqueue_style('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array('gmedia-bootstrap'), '0.8.5', 'screen');
307
- wp_enqueue_script('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array('jquery'), '0.8.5');
308
  }
309
- if($gmCore->caps['gmedia_upload']){
310
- $tab = $gmCore->_get('tab', 'upload');
311
- if($tab == 'upload'){
312
- wp_enqueue_style('jquery-ui-smoothness', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css', array(), '1.10.2', 'screen');
313
- wp_enqueue_script('jquery-ui-full', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js', array(), '1.10.2');
314
 
315
- wp_enqueue_script('gmedia-plupload', $gmCore->gmedia_url . '/assets/plupload/plupload.full.min.js', array('jquery', 'jquery-ui-full'), '2.1.2');
316
 
317
- wp_enqueue_style('jquery.ui.plupload', $gmCore->gmedia_url . '/assets/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css', array('jquery-ui-smoothness'), '2.1.2', 'screen');
318
- wp_enqueue_script('jquery.ui.plupload', $gmCore->gmedia_url . '/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js', array(
319
- 'gmedia-plupload',
320
- 'jquery-ui-full'
321
- ), '2.1.2');
322
 
323
  }
324
  }
@@ -327,25 +316,25 @@ class GmediaAdmin{
327
  // enqueue jscolor
328
  break;
329
  case "GrandMedia_Galleries" :
330
- if($gmCore->caps['gmedia_gallery_manage'] && (isset($_GET['gallery_module']) || isset($_GET['edit_gallery']))){
331
- wp_enqueue_style('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array('gmedia-bootstrap'), '0.8.5', 'screen');
332
- wp_enqueue_script('selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array('jquery', 'jquery-ui-sortable'), '0.8.5');
333
 
334
- wp_enqueue_style('jquery.minicolors', $gmCore->gmedia_url . '/assets/minicolors/jquery.minicolors.css', array('gmedia-bootstrap'), '0.9.13');
335
- wp_enqueue_script('jquery.minicolors', $gmCore->gmedia_url . '/assets/minicolors/jquery.minicolors.js', array('jquery'), '0.9.13');
336
  }
337
  break;
338
  }
339
  }
340
 
341
- wp_enqueue_style('grand-media');
342
- wp_enqueue_script('grand-media');
343
 
344
  }
345
 
346
- function screen_help(){
347
- $screen = get_current_screen();
348
- $screen_id = explode('page_', $screen->id, 2);
349
  $screen_id = $screen_id[1];
350
 
351
  /*
@@ -357,9 +346,9 @@ class GmediaAdmin{
357
  }
358
  */
359
 
360
- $screen->add_help_tab(array(
361
- 'id' => 'help_' . $screen_id . '_support',
362
- 'title' => __('Support'),
363
  'content' => '<h4>First steps</h4>
364
  <p>If you have any problems with displaying Gmedia Gallery in admin or on website. Before posting to the Forum try next:</p>
365
  <ul>
@@ -367,12 +356,12 @@ class GmediaAdmin{
367
  <li>Exclude theme conflict: Temporary switch to one of default themes and check if gallery works</li>
368
  </ul>
369
  <h4>Links</h4>
370
- <p><a href="http://codeasily.com/community/forum/gmedia-gallery-wordpress-plugin/" target="_blank">' . __('Support Forum', 'gmLang') . '</a>
371
- | <a href="http://codeasily.com/contact/" target="_blank">' . __('Contact', 'gmLang') . '</a>
372
- | <a href="http://codeasily.com/portfolio/gmedia-gallery-modules/" target="_blank">' . __('Demo', 'gmLang') . '</a>
373
- | <a href="http://codeasily.com/product/one-site-license/" target="_blank">' . __('Premium', 'gmLang') . '</a>
374
  </p>',
375
- ));
376
 
377
  }
378
 
@@ -382,51 +371,51 @@ class GmediaAdmin{
382
  *
383
  * @return string
384
  */
385
- function screen_settings($current, $screen){
386
  global $gmProcessor, $gmCore;
387
- if(in_array($screen->id, $this->pages)){
388
 
389
  $gm_screen_options = $gmProcessor->user_options();
390
 
391
- $title = '<h5><strong>' . __('Settings', 'gmLang') . '</strong></h5>';
392
  $wp_screen_options = '<input type="hidden" name="wp_screen_options[option]" value="gm_screen_options" /><input type="hidden" name="wp_screen_options[value]" value="' . $screen->id . '" />';
393
- $button = get_submit_button(__('Apply', 'gmLang'), 'button', 'screen-options-apply', false);
394
 
395
  $settings = false;
396
 
397
- $screen_id = explode('page_', $screen->id, 2);
398
 
399
- switch($screen_id[1]){
400
  case 'GrandMedia' :
401
  $settings = '
402
  <div class="form-inline pull-left">
403
  <div class="form-group">
404
- <input type="number" max="999" min="0" step="5" size="3" name="gm_screen_options[per_page_gmedia]" class="form-control input-sm" style="width: auto;" value="' . $gm_screen_options['per_page_gmedia'] . '" /> <span>' . __('items per page', 'gmLang') . '</span>
405
  </div>
406
  <div class="form-group">
407
  <select name="gm_screen_options[orderby_gmedia]" class="form-control input-sm">
408
- <option' . selected($gm_screen_options['orderby_gmedia'], 'ID', false) . ' value="ID">' . __('ID', 'gmLang') . '</option>
409
- <option' . selected($gm_screen_options['orderby_gmedia'], 'title', false) . ' value="title">' . __('Title', 'gmLang') . '</option>
410
- <option' . selected($gm_screen_options['orderby_gmedia'], 'date', false) . ' value="date">' . __('Date', 'gmLang') . '</option>
411
- <option' . selected($gm_screen_options['orderby_gmedia'], 'modified', false) . ' value="modified">' . __('Last Modified', 'gmLang') . '</option>
412
- <option' . selected($gm_screen_options['orderby_gmedia'], 'mime_type', false) . ' value="mime_type">' . __('MIME Type', 'gmLang') . '</option>
413
- <option' . selected($gm_screen_options['orderby_gmedia'], 'author', false) . ' value="author">' . __('Author', 'gmLang') . '</option>
414
- </select> <span>' . __('order items', 'gmLang') . '</span>
415
  </div>
416
  <div class="form-group">
417
  <select name="gm_screen_options[sortorder_gmedia]" class="form-control input-sm">
418
- <option' . selected($gm_screen_options['sortorder_gmedia'], 'DESC', false) . ' value="DESC">' . __('DESC', 'gmLang') . '</option>
419
- <option' . selected($gm_screen_options['sortorder_gmedia'], 'ASC', false) . ' value="ASC">' . __('ASC', 'gmLang') . '</option>
420
- </select> <span>' . __('sort order', 'gmLang') . '</span>
421
  </div>
422
  ';
423
- if('edit' == $gmCore->_get('mode')){
424
  $settings .= '
425
  <div class="form-group">
426
  <select name="gm_screen_options[library_edit_quicktags]" class="form-control input-sm">
427
- <option' . selected($gm_screen_options['library_edit_quicktags'], 'false', false) . ' value="false">' . __('FALSE', 'gmLang') . '</option>
428
- <option' . selected($gm_screen_options['library_edit_quicktags'], 'true', false) . ' value="true">' . __('TRUE', 'gmLang') . '</option>
429
- </select> <span>' . __('Quick Tags panel for Description field', 'gmLang') . '</span>
430
  </div>
431
  ';
432
  }
@@ -435,54 +424,54 @@ class GmediaAdmin{
435
  ';
436
  break;
437
  case 'GrandMedia_WordpressLibrary' :
438
- $settings = '<p>' . __('Set query options for this page to be loaded by default.', 'gmLang') . '</p>
439
  <div class="form-inline pull-left">
440
  <div class="form-group">
441
- <input type="number" max="999" min="0" step="5" size="3" name="gm_screen_options[per_page_wpmedia]" class="form-control input-sm" style="width: auto;" value="' . $gm_screen_options['per_page_wpmedia'] . '" /> <span>' . __('items per page', 'gmLang') . '</span>
442
  </div>
443
  <div class="form-group">
444
  <select name="gm_screen_options[orderby_wpmedia]" class="form-control input-sm">
445
- <option' . selected($gm_screen_options['orderby_wpmedia'], 'ID', false) . ' value="ID">' . __('ID', 'gmLang') . '</option>
446
- <option' . selected($gm_screen_options['orderby_wpmedia'], 'title', false) . ' value="title">' . __('Title', 'gmLang') . '</option>
447
- <option' . selected($gm_screen_options['orderby_wpmedia'], 'date', false) . ' value="date">' . __('Date', 'gmLang') . '</option>
448
- <option' . selected($gm_screen_options['orderby_wpmedia'], 'modified', false) . ' value="modified">' . __('Last Modified', 'gmLang') . '</option>
449
- <option' . selected($gm_screen_options['orderby_wpmedia'], 'mime_type', false) . ' value="mime_type">' . __('MIME Type', 'gmLang') . '</option>
450
- <option' . selected($gm_screen_options['orderby_wpmedia'], 'author', false) . ' value="author">' . __('Author', 'gmLang') . '</option>
451
- </select> <span>' . __('order items', 'gmLang') . '</span>
452
  </div>
453
  <div class="form-group">
454
  <select name="gm_screen_options[sortorder_wpmedia]" class="form-control input-sm">
455
- <option' . selected($gm_screen_options['sortorder_wpmedia'], 'DESC', false) . ' value="DESC">' . __('DESC', 'gmLang') . '</option>
456
- <option' . selected($gm_screen_options['sortorder_wpmedia'], 'ASC', false) . ' value="ASC">' . __('ASC', 'gmLang') . '</option>
457
- </select> <span>' . __('sort order', 'gmLang') . '</span>
458
  </div>
459
  </div>
460
  ';
461
  break;
462
  case 'GrandMedia_AddMedia' :
463
- $tab = $gmCore->_get('tab', 'upload');
464
- if('upload' == $tab){
465
- $html4_hide = ('html4' == $gm_screen_options['uploader_runtime'])? ' hide' : '';
466
- $settings = '
467
  <div class="form-inline pull-left">
468
- <div id="uploader_runtime" class="form-group"><span>' . __('Uploader runtime:', 'gmLang') . ' </span>
469
  <select name="gm_screen_options[uploader_runtime]" class="form-control input-sm">
470
- <option' . selected($gm_screen_options['uploader_runtime'], 'auto', false) . ' value="auto">' . __('Auto', 'gmLang') . '</option>
471
- <option' . selected($gm_screen_options['uploader_runtime'], 'html5', false) . ' value="html5">' . __('HTML5 Uploader', 'gmLang') . '</option>
472
- <option' . selected($gm_screen_options['uploader_runtime'], 'flash', false) . ' value="flash">' . __('Flash Uploader', 'gmLang') . '</option>
473
- <option' . selected($gm_screen_options['uploader_runtime'], 'html4', false) . ' value="html4">' . __('HTML4 Uploader', 'gmLang') . '</option>
474
  </select>
475
  </div>
476
- <div id="uploader_chunking" class="form-group' . $html4_hide . '"><span>' . __('Chunking:', 'gmLang') . ' </span>
477
  <select name="gm_screen_options[uploader_chunking]" class="form-control input-sm">
478
- <option' . selected($gm_screen_options['uploader_chunking'], 'true', false) . ' value="true">' . __('TRUE', 'gmLang') . '</option>
479
- <option' . selected($gm_screen_options['uploader_chunking'], 'false', false) . ' value="false">' . __('FALSE', 'gmLang') . '</option>
480
  </select>
481
  </div>
482
- <div id="uploader_urlstream_upload" class="form-group' . $html4_hide . '"><span>' . __('URL streem upload:', 'gmLang') . ' </span>
483
  <select name="gm_screen_options[uploader_urlstream_upload]" class="form-control input-sm">
484
- <option' . selected($gm_screen_options['uploader_urlstream_upload'], 'true', false) . ' value="true">' . __('TRUE', 'gmLang') . '</option>
485
- <option' . selected($gm_screen_options['uploader_urlstream_upload'], 'false', false) . ' value="false">' . __('FALSE', 'gmLang') . '</option>
486
  </select>
487
  </div>
488
  </div>
@@ -491,7 +480,7 @@ class GmediaAdmin{
491
  break;
492
  }
493
 
494
- if($settings){
495
  $current = $title . $settings . $wp_screen_options . $button;
496
  }
497
 
@@ -507,9 +496,9 @@ class GmediaAdmin{
507
  *
508
  * @return array
509
  */
510
- function screen_settings_save($status, $option, $value){
511
  global $user_ID;
512
- if('gm_screen_options' == $option){
513
  /*
514
  global $gmGallery;
515
  foreach ( $_POST['gm_screen_options'] as $key => $val ) {
@@ -517,11 +506,11 @@ class GmediaAdmin{
517
  }
518
  update_option( 'gmediaOptions', $gmGallery->options );
519
  */
520
- $gm_screen_options = get_user_meta($user_ID, 'gm_screen_options', true);
521
- if(!is_array($gm_screen_options)){
522
  $gm_screen_options = array();
523
  }
524
- $value = array_merge($gm_screen_options, $_POST['gm_screen_options']);
525
 
526
  return $value;
527
  }
4
  * GmediaAdmin - Admin Section for GRAND Media
5
  *
6
  */
7
+ class GmediaAdmin {
8
  var $pages = array();
9
 
10
  /**
11
  * constructor
12
  */
13
+ function __construct() {
14
  global $pagenow;
15
 
16
  // Add the admin menu
17
+ add_action( 'admin_menu', array( &$this, 'add_menu' ) );
18
 
19
  // Add the script and style files
20
+ add_action( 'admin_enqueue_scripts', array( &$this, 'load_scripts' ) );
21
 
22
+ add_filter( 'screen_settings', array( &$this, 'screen_settings' ), 10, 2 );
23
+ add_filter( 'set-screen-option', array( &$this, 'screen_settings_save' ), 11, 3 );
24
 
25
+ if ( ( 'admin.php' == $pagenow ) && isset( $_GET['page'] ) && ( false !== strpos( $_GET['page'], 'GrandMedia' ) ) && isset( $_GET['gmediablank'] ) ) {
26
+ add_action( 'admin_init', array( &$this, 'gmedia_blank_page' ) );
27
  }
28
 
29
  }
31
  /**
32
  * Load gmedia pages in wpless interface
33
  */
34
+ function gmedia_blank_page() {
35
+ set_current_screen( 'GrandMedia_Settings' );
36
 
37
  global $gmCore;
38
+ $gmediablank = $gmCore->_get( 'gmediablank', '' );
39
  /*
40
  add_filter('admin_body_class', function(){
41
  $gmediablank = isset($_GET['gmediablank'])? $_GET['gmediablank'] : '';
42
  return "gmedia-blank $gmediablank"; });
43
  */
44
+ add_filter( 'admin_body_class', create_function( '', '$gmediablank = isset($_GET["gmediablank"])? $_GET["gmediablank"] : ""; return "gmedia-blank $gmediablank";' ) );
45
+ define( 'IFRAME_REQUEST', true );
46
 
47
+ iframe_header( 'GmediaGallery' );
48
 
49
+ switch ( $gmediablank ) {
50
  case 'update_plugin':
51
+ require_once( dirname( dirname( __FILE__ ) ) . '/update.php' );
52
  gmedia_do_update();
53
  break;
54
  case 'image_editor':
55
+ require_once( dirname( dirname( __FILE__ ) ) . '/inc/image-editor.php' );
56
  gmedia_image_editor();
57
  break;
58
  }
64
  /**
65
  * @return string
66
  */
67
+ function gmedia_blank_page_body_class() {
68
  return 'gmedia-blank';
69
  }
70
 
71
  // integrate the menu
72
+ function add_menu() {
73
+ $gmediaURL = plugins_url( GMEDIA_FOLDER );
74
+ $this->pages = array();
75
+ $this->pages[] = add_object_page( __( 'Gmedia Library', 'gmLang' ), 'Gmedia Gallery', 'gmedia_library', 'GrandMedia', array( &$this, 'shell' ), $gmediaURL . '/admin/images/gm-icon.png' );
76
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Gmedia Library', 'gmLang' ), __( 'Gmedia Library', 'gmLang' ), 'gmedia_library', 'GrandMedia', array( &$this, 'shell' ) );
77
+ if ( current_user_can( 'gmedia_library' ) ) {
78
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Add Media Files', 'gmLang' ), __( 'Add/Import Files', 'gmLang' ), 'gmedia_upload', 'GrandMedia_AddMedia', array( &$this, 'shell' ) );
79
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Albums, Tags...', 'gmLang' ), __( 'Albums, Tags...', 'gmLang' ), 'gmedia_library', 'GrandMedia_Terms', array( &$this, 'shell' ) );
80
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Gmedia Galleries', 'gmLang' ), __( 'Create/Manage Galleries...', 'gmLang' ), 'gmedia_gallery_manage', 'GrandMedia_Galleries', array( &$this, 'shell' ) );
81
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Modules', 'gmLang' ), __( 'Modules', 'gmLang' ), 'gmedia_gallery_manage', 'GrandMedia_Modules', array( &$this, 'shell' ) );
82
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Gmedia Settings', 'gmLang' ), __( 'Settings', 'gmLang' ), 'gmedia_settings', 'GrandMedia_Settings', array( &$this, 'shell' ) );
83
+ $this->pages[] = add_submenu_page( 'GrandMedia', __( 'Wordpress Media Library', 'gmLang' ), __( 'WP Media Library', 'gmLang' ), 'gmedia_import', 'GrandMedia_WordpressLibrary', array( &$this, 'shell' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  }
85
 
86
+ foreach ( $this->pages as $page ) {
87
+ add_action( "load-$page", array( &$this, 'screen_help' ) );
88
  }
89
  }
90
 
92
  * Load the script for the defined page and load only this code
93
  * Display shell of plugin
94
  */
95
+ function shell() {
96
  global $gmProcessor;
97
 
98
  // check for upgrade
99
+ if ( get_option( 'gmediaDbVersion' ) != GMEDIA_DBVERSION ) {
100
+ if ( isset( $_GET['do_update'] ) && ( 'gmedia' == $_GET['do_update'] ) ) {
101
+ $update_frame = '<iframe name="gmedia_update" id="gmedia_update" width="100%" height="500" src="' . admin_url( 'admin.php?page=GrandMedia&gmediablank=update_plugin' ) . '"></iframe>';
102
  $gmProcessor->page = 'GrandMedia_Update';
103
+ } else {
104
  return;
105
  }
106
  }
107
 
108
  $sideLinks = $this->sideLinks();
109
 
110
+ if ( isset( $update_frame ) ) {
111
+ $sideLinks['grandTitle'] = __( 'Updating GmediaGallery Plugin', 'gmLang' );
112
  }
113
  ?>
114
  <div id="gmedia-container">
118
  </div>
119
  <h2><?php echo $sideLinks['grandTitle']; ?></h2>
120
  </div>
 
121
  <div class="container-fluid">
122
  <div class="row row-fx180-fl">
123
  <div class="col-sm-2 hidden-xs" id="sidebar" role="navigation">
124
  <?php echo $sideLinks['sideLinks']; ?>
125
  </div>
126
  <div class="col-sm-10 col-xs-12">
127
+ <div id="gm-message"><?php
128
+ echo $gmProcessor->alert( 'success', $gmProcessor->msg );
129
+ echo $gmProcessor->alert( 'danger', $gmProcessor->error );
130
+ ?></div>
131
  <?php
132
+ if ( isset( $update_frame ) ) {
 
 
 
133
  ?>
134
  <div class="panel panel-default">
135
  <div class="panel-body"><?php echo $update_frame; ?></div>
136
  </div>
137
  <?php
138
+ } else {
139
  $this->controller();
140
  }
141
  ?>
146
  <?php
147
  }
148
 
149
+ function sideLinks() {
150
  global $submenu, $gmProcessor;
151
  $content['sideLinks'] = '
152
  <div id="gmedia-navbar">
153
  <div class="row">
154
  <ul class="list-group">';
155
+ foreach ( $submenu['GrandMedia'] as $menuKey => $menuItem ) {
156
+ if ( $submenu['GrandMedia'][ $menuKey ][2] == $gmProcessor->page ) {
157
+ $iscur = ' active';
158
+ $content['grandTitle'] = $submenu['GrandMedia'][ $menuKey ][3];
159
+ } else {
160
  $iscur = '';
161
  }
162
 
163
+ $content['sideLinks'] .= "\n" . '<a class="list-group-item' . $iscur . '" href="' . admin_url( 'admin.php?page=' . $submenu['GrandMedia'][ $menuKey ][2] ) . '">' . $submenu['GrandMedia'][ $menuKey ][0] . '</a>';
164
  }
165
  $content['sideLinks'] .= '
166
  </ul>
170
  return $content;
171
  }
172
 
173
+ function controller() {
174
 
175
  global $gmProcessor;
176
+ switch ( $gmProcessor->page ) {
177
  case 'GrandMedia_AddMedia':
178
+ include_once( dirname( __FILE__ ) . '/addmedia.php' );
179
  gmedia_AddMedia();
180
  break;
181
  case 'GrandMedia_Terms':
182
+ include_once( dirname( __FILE__ ) . '/terms.php' );
183
+ if ( isset( $_GET['edit_album'] ) ) {
184
  gmediaAlbumEdit();
185
+ } else {
186
  gmediaTerms();
187
  }
188
  break;
189
  case 'GrandMedia_Galleries':
190
+ include_once( dirname( __FILE__ ) . '/galleries.php' );
191
+ if ( isset( $_GET['gallery_module'] ) || isset( $_GET['edit_gallery'] ) ) {
192
  gmediaGalleryEdit();
193
+ } else {
194
  gmediaGalleries();
195
  }
196
  break;
197
  case 'GrandMedia_Modules':
198
+ include_once( dirname( __FILE__ ) . '/modules.php' );
199
  gmediaModules();
200
  break;
201
  case 'GrandMedia_Settings':
202
+ include_once( dirname( __FILE__ ) . '/settings.php' );
203
  gmSettings();
204
  break;
205
  case 'GrandMedia_WordpressLibrary':
206
+ include_once( dirname( __FILE__ ) . '/wpmedia.php' );
207
  grandWPMedia();
208
  break;
209
  case 'GrandMedia':
210
  default:
211
+ include_once( dirname( __FILE__ ) . '/gmedia.php' );
212
  gmediaLib();
213
  break;
214
  }
217
  /**
218
  * @param $hook
219
  */
220
+ function load_scripts( $hook ) {
221
+ global $gmCore, $gmProcessor, $gmGallery;
222
 
223
  // no need to go on if it's not a plugin page
224
+ if ( 'admin.php' != $hook && strpos( $gmCore->_get( 'page' ), 'GrandMedia' ) === false ) {
225
  return;
226
  }
227
 
228
+ if($gmGallery->options['isolation_mode']) {
229
+ global $wp_scripts, $wp_styles;
230
+ foreach ( $wp_scripts->registered as $handle => $wp_script ) {
231
+ if ( ( false !== strpos( $wp_script->src, '/plugins/' ) ) && ( false === strpos( $wp_script->src, GMEDIA_FOLDER ) ) ) {
232
+ if ( in_array( $handle, $wp_scripts->queue ) ) {
233
+ wp_dequeue_script( $handle );
234
+ }
235
+ wp_deregister_script( $handle );
236
+ }
237
+ }
238
+ foreach ( $wp_styles->registered as $handle => $wp_style ) {
239
+ if ( ( false !== strpos( $wp_style->src, '/plugins/' ) ) && ( false === strpos( $wp_style->src, GMEDIA_FOLDER ) ) ) {
240
+ if ( in_array( $handle, $wp_styles->queue ) ) {
241
+ wp_dequeue_style( $handle );
242
+ }
243
+ wp_deregister_style( $handle );
244
+ }
245
+ }
246
+ }
247
+
248
+ wp_enqueue_style( 'gmedia-bootstrap' );
249
  //wp_enqueue_style( 'gmedia-bootstrap-theme' );
250
+ wp_enqueue_script( 'gmedia-bootstrap' );
251
 
252
  //wp_enqueue_script( 'outside-events' );
253
 
254
+ if ( isset( $_GET['page'] ) ) {
255
+ switch ( $_GET['page'] ) {
256
  case "GrandMedia" :
257
+ if ( $gmCore->caps['gmedia_edit_media'] ) {
258
+ if ( $gmCore->_get( 'gmediablank' ) == 'image_editor' ) {
259
+ wp_enqueue_script( 'camanjs', $gmCore->gmedia_url . '/assets/image-editor/camanjs/caman.full.min.js', array(), '4.1.1' );
260
 
261
+ wp_enqueue_style( 'nouislider', $gmCore->gmedia_url . '/assets/image-editor/js/jquery.nouislider.css', array( 'gmedia-bootstrap' ), '6.1.0' );
262
+ wp_enqueue_script( 'nouislider', $gmCore->gmedia_url . '/assets/image-editor/js/jquery.nouislider.min.js', array( 'jquery' ), '6.1.0' );
263
 
264
+ wp_enqueue_style( 'gmedia-image-editor', $gmCore->gmedia_url . '/assets/image-editor/style.css', array( 'gmedia-bootstrap' ), '0.9.16', 'screen' );
265
+ wp_enqueue_script( 'gmedia-image-editor', $gmCore->gmedia_url . '/assets/image-editor/image-editor.js', array( 'jquery', 'camanjs' ), '0.9.16' );
266
  break;
267
  }
268
+ if ( $gmProcessor->mode ) {
269
+ wp_enqueue_script( 'alphanum', $gmCore->gmedia_url . '/assets/jq-plugins/jquery.alphanum.js', array( 'jquery' ), '1.0.16' );
270
+
271
+ wp_enqueue_script( 'moment', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/moment.min.js', array( 'jquery' ), '2.5.1' );
272
+ wp_enqueue_style( 'datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css', array( 'gmedia-bootstrap' ), '2.1.32' );
273
+ wp_enqueue_script( 'datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js', array( 'jquery', 'moment', 'gmedia-bootstrap' ), '2.1.32' );
 
 
 
 
274
  }
275
  }
276
+ if ( $gmCore->caps['gmedia_terms'] ) {
277
+ wp_enqueue_style( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array( 'gmedia-bootstrap' ), '0.8.5', 'screen' );
278
+ wp_enqueue_script( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array( 'jquery' ), '0.8.5' );
279
  }
280
  break;
281
  case "GrandMedia_WordpressLibrary" :
282
+ if ( $gmCore->caps['gmedia_import'] ) {
283
+ wp_enqueue_style( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array( 'gmedia-bootstrap' ), '0.8.5', 'screen' );
284
+ wp_enqueue_script( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array( 'jquery' ), '0.8.5' );
285
  }
286
  break;
287
  case "GrandMedia_Terms" :
288
+ if ( $gmCore->_get( 'edit_album' ) && $gmCore->caps['gmedia_album_manage'] ) {
289
+ wp_enqueue_style( 'jquery-ui-smoothness', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css', array(), '1.10.2', 'screen' );
290
+ wp_enqueue_script( 'jquery-ui-full', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js', array(), '1.10.2' );
291
 
292
+ wp_enqueue_script( 'tinysort', $gmCore->gmedia_url . '/assets/jq-plugins/jquery.tinysort.js', array( 'jquery' ), '1.5.6' );
293
  }
294
 
295
  break;
296
  case "GrandMedia_AddMedia" :
297
+ if ( $gmCore->caps['gmedia_terms'] ) {
298
+ wp_enqueue_style( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array( 'gmedia-bootstrap' ), '0.8.5', 'screen' );
299
+ wp_enqueue_script( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array( 'jquery' ), '0.8.5' );
300
  }
301
+ if ( $gmCore->caps['gmedia_upload'] ) {
302
+ $tab = $gmCore->_get( 'tab', 'upload' );
303
+ if ( $tab == 'upload' ) {
304
+ wp_enqueue_style( 'jquery-ui-smoothness', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css', array(), '1.10.2', 'screen' );
305
+ wp_enqueue_script( 'jquery-ui-full', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js', array(), '1.10.2' );
306
 
307
+ wp_enqueue_script( 'gmedia-plupload', $gmCore->gmedia_url . '/assets/plupload/plupload.full.min.js', array( 'jquery', 'jquery-ui-full' ), '2.1.2' );
308
 
309
+ wp_enqueue_style( 'jquery.ui.plupload', $gmCore->gmedia_url . '/assets/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css', array( 'jquery-ui-smoothness' ), '2.1.2', 'screen' );
310
+ wp_enqueue_script( 'jquery.ui.plupload', $gmCore->gmedia_url . '/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js', array( 'gmedia-plupload', 'jquery-ui-full' ), '2.1.2' );
 
 
 
311
 
312
  }
313
  }
316
  // enqueue jscolor
317
  break;
318
  case "GrandMedia_Galleries" :
319
+ if ( $gmCore->caps['gmedia_gallery_manage'] && ( isset( $_GET['gallery_module'] ) || isset( $_GET['edit_gallery'] ) ) ) {
320
+ wp_enqueue_style( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array( 'gmedia-bootstrap' ), '0.8.5', 'screen' );
321
+ wp_enqueue_script( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array( 'jquery', 'jquery-ui-sortable' ), '0.8.5' );
322
 
323
+ wp_enqueue_style( 'jquery.minicolors', $gmCore->gmedia_url . '/assets/minicolors/jquery.minicolors.css', array( 'gmedia-bootstrap' ), '0.9.13' );
324
+ wp_enqueue_script( 'jquery.minicolors', $gmCore->gmedia_url . '/assets/minicolors/jquery.minicolors.js', array( 'jquery' ), '0.9.13' );
325
  }
326
  break;
327
  }
328
  }
329
 
330
+ wp_enqueue_style( 'grand-media' );
331
+ wp_enqueue_script( 'grand-media' );
332
 
333
  }
334
 
335
+ function screen_help() {
336
+ $screen = get_current_screen();
337
+ $screen_id = explode( 'page_', $screen->id, 2 );
338
  $screen_id = $screen_id[1];
339
 
340
  /*
346
  }
347
  */
348
 
349
+ $screen->add_help_tab( array(
350
+ 'id' => 'help_' . $screen_id . '_support',
351
+ 'title' => __( 'Support' ),
352
  'content' => '<h4>First steps</h4>
353
  <p>If you have any problems with displaying Gmedia Gallery in admin or on website. Before posting to the Forum try next:</p>
354
  <ul>
356
  <li>Exclude theme conflict: Temporary switch to one of default themes and check if gallery works</li>
357
  </ul>
358
  <h4>Links</h4>
359
+ <p><a href="http://codeasily.com/community/forum/gmedia-gallery-wordpress-plugin/" target="_blank">' . __( 'Support Forum', 'gmLang' ) . '</a>
360
+ | <a href="http://codeasily.com/contact/" target="_blank">' . __( 'Contact', 'gmLang' ) . '</a>
361
+ | <a href="http://codeasily.com/portfolio/gmedia-gallery-modules/" target="_blank">' . __( 'Demo', 'gmLang' ) . '</a>
362
+ | <a href="http://codeasily.com/product/one-site-license/" target="_blank">' . __( 'Premium', 'gmLang' ) . '</a>
363
  </p>',
364
+ ) );
365
 
366
  }
367
 
371
  *
372
  * @return string
373
  */
374
+ function screen_settings( $current, $screen ) {
375
  global $gmProcessor, $gmCore;
376
+ if ( in_array( $screen->id, $this->pages ) ) {
377
 
378
  $gm_screen_options = $gmProcessor->user_options();
379
 
380
+ $title = '<h5><strong>' . __( 'Settings', 'gmLang' ) . '</strong></h5>';
381
  $wp_screen_options = '<input type="hidden" name="wp_screen_options[option]" value="gm_screen_options" /><input type="hidden" name="wp_screen_options[value]" value="' . $screen->id . '" />';
382
+ $button = get_submit_button( __( 'Apply', 'gmLang' ), 'button', 'screen-options-apply', false );
383
 
384
  $settings = false;
385
 
386
+ $screen_id = explode( 'page_', $screen->id, 2 );
387
 
388
+ switch ( $screen_id[1] ) {
389
  case 'GrandMedia' :
390
  $settings = '
391
  <div class="form-inline pull-left">
392
  <div class="form-group">
393
+ <input type="number" max="999" min="0" step="5" size="3" name="gm_screen_options[per_page_gmedia]" class="form-control input-sm" style="width: auto;" value="' . $gm_screen_options['per_page_gmedia'] . '" /> <span>' . __( 'items per page', 'gmLang' ) . '</span>
394
  </div>
395
  <div class="form-group">
396
  <select name="gm_screen_options[orderby_gmedia]" class="form-control input-sm">
397
+ <option' . selected( $gm_screen_options['orderby_gmedia'], 'ID', false ) . ' value="ID">' . __( 'ID', 'gmLang' ) . '</option>
398
+ <option' . selected( $gm_screen_options['orderby_gmedia'], 'title', false ) . ' value="title">' . __( 'Title', 'gmLang' ) . '</option>
399
+ <option' . selected( $gm_screen_options['orderby_gmedia'], 'date', false ) . ' value="date">' . __( 'Date', 'gmLang' ) . '</option>
400
+ <option' . selected( $gm_screen_options['orderby_gmedia'], 'modified', false ) . ' value="modified">' . __( 'Last Modified', 'gmLang' ) . '</option>
401
+ <option' . selected( $gm_screen_options['orderby_gmedia'], 'mime_type', false ) . ' value="mime_type">' . __( 'MIME Type', 'gmLang' ) . '</option>
402
+ <option' . selected( $gm_screen_options['orderby_gmedia'], 'author', false ) . ' value="author">' . __( 'Author', 'gmLang' ) . '</option>
403
+ </select> <span>' . __( 'order items', 'gmLang' ) . '</span>
404
  </div>
405
  <div class="form-group">
406
  <select name="gm_screen_options[sortorder_gmedia]" class="form-control input-sm">
407
+ <option' . selected( $gm_screen_options['sortorder_gmedia'], 'DESC', false ) . ' value="DESC">' . __( 'DESC', 'gmLang' ) . '</option>
408
+ <option' . selected( $gm_screen_options['sortorder_gmedia'], 'ASC', false ) . ' value="ASC">' . __( 'ASC', 'gmLang' ) . '</option>
409
+ </select> <span>' . __( 'sort order', 'gmLang' ) . '</span>
410
  </div>
411
  ';
412
+ if ( 'edit' == $gmCore->_get( 'mode' ) ) {
413
  $settings .= '
414
  <div class="form-group">
415
  <select name="gm_screen_options[library_edit_quicktags]" class="form-control input-sm">
416
+ <option' . selected( $gm_screen_options['library_edit_quicktags'], 'false', false ) . ' value="false">' . __( 'FALSE', 'gmLang' ) . '</option>
417
+ <option' . selected( $gm_screen_options['library_edit_quicktags'], 'true', false ) . ' value="true">' . __( 'TRUE', 'gmLang' ) . '</option>
418
+ </select> <span>' . __( 'Quick Tags panel for Description field', 'gmLang' ) . '</span>
419
  </div>
420
  ';
421
  }
424
  ';
425
  break;
426
  case 'GrandMedia_WordpressLibrary' :
427
+ $settings = '<p>' . __( 'Set query options for this page to be loaded by default.', 'gmLang' ) . '</p>
428
  <div class="form-inline pull-left">
429
  <div class="form-group">
430
+ <input type="number" max="999" min="0" step="5" size="3" name="gm_screen_options[per_page_wpmedia]" class="form-control input-sm" style="width: auto;" value="' . $gm_screen_options['per_page_wpmedia'] . '" /> <span>' . __( 'items per page', 'gmLang' ) . '</span>
431
  </div>
432
  <div class="form-group">
433
  <select name="gm_screen_options[orderby_wpmedia]" class="form-control input-sm">
434
+ <option' . selected( $gm_screen_options['orderby_wpmedia'], 'ID', false ) . ' value="ID">' . __( 'ID', 'gmLang' ) . '</option>
435
+ <option' . selected( $gm_screen_options['orderby_wpmedia'], 'title', false ) . ' value="title">' . __( 'Title', 'gmLang' ) . '</option>
436
+ <option' . selected( $gm_screen_options['orderby_wpmedia'], 'date', false ) . ' value="date">' . __( 'Date', 'gmLang' ) . '</option>
437
+ <option' . selected( $gm_screen_options['orderby_wpmedia'], 'modified', false ) . ' value="modified">' . __( 'Last Modified', 'gmLang' ) . '</option>
438
+ <option' . selected( $gm_screen_options['orderby_wpmedia'], 'mime_type', false ) . ' value="mime_type">' . __( 'MIME Type', 'gmLang' ) . '</option>
439
+ <option' . selected( $gm_screen_options['orderby_wpmedia'], 'author', false ) . ' value="author">' . __( 'Author', 'gmLang' ) . '</option>
440
+ </select> <span>' . __( 'order items', 'gmLang' ) . '</span>
441
  </div>
442
  <div class="form-group">
443
  <select name="gm_screen_options[sortorder_wpmedia]" class="form-control input-sm">
444
+ <option' . selected( $gm_screen_options['sortorder_wpmedia'], 'DESC', false ) . ' value="DESC">' . __( 'DESC', 'gmLang' ) . '</option>
445
+ <option' . selected( $gm_screen_options['sortorder_wpmedia'], 'ASC', false ) . ' value="ASC">' . __( 'ASC', 'gmLang' ) . '</option>
446
+ </select> <span>' . __( 'sort order', 'gmLang' ) . '</span>
447
  </div>
448
  </div>
449
  ';
450
  break;
451
  case 'GrandMedia_AddMedia' :
452
+ $tab = $gmCore->_get( 'tab', 'upload' );
453
+ if ( 'upload' == $tab ) {
454
+ $html4_hide = ( 'html4' == $gm_screen_options['uploader_runtime'] ) ? ' hide' : '';
455
+ $settings = '
456
  <div class="form-inline pull-left">
457
+ <div id="uploader_runtime" class="form-group"><span>' . __( 'Uploader runtime:', 'gmLang' ) . ' </span>
458
  <select name="gm_screen_options[uploader_runtime]" class="form-control input-sm">
459
+ <option' . selected( $gm_screen_options['uploader_runtime'], 'auto', false ) . ' value="auto">' . __( 'Auto', 'gmLang' ) . '</option>
460
+ <option' . selected( $gm_screen_options['uploader_runtime'], 'html5', false ) . ' value="html5">' . __( 'HTML5 Uploader', 'gmLang' ) . '</option>
461
+ <option' . selected( $gm_screen_options['uploader_runtime'], 'flash', false ) . ' value="flash">' . __( 'Flash Uploader', 'gmLang' ) . '</option>
462
+ <option' . selected( $gm_screen_options['uploader_runtime'], 'html4', false ) . ' value="html4">' . __( 'HTML4 Uploader', 'gmLang' ) . '</option>
463
  </select>
464
  </div>
465
+ <div id="uploader_chunking" class="form-group' . $html4_hide . '"><span>' . __( 'Chunking:', 'gmLang' ) . ' </span>
466
  <select name="gm_screen_options[uploader_chunking]" class="form-control input-sm">
467
+ <option' . selected( $gm_screen_options['uploader_chunking'], 'true', false ) . ' value="true">' . __( 'TRUE', 'gmLang' ) . '</option>
468
+ <option' . selected( $gm_screen_options['uploader_chunking'], 'false', false ) . ' value="false">' . __( 'FALSE', 'gmLang' ) . '</option>
469
  </select>
470
  </div>
471
+ <div id="uploader_urlstream_upload" class="form-group' . $html4_hide . '"><span>' . __( 'URL streem upload:', 'gmLang' ) . ' </span>
472
  <select name="gm_screen_options[uploader_urlstream_upload]" class="form-control input-sm">
473
+ <option' . selected( $gm_screen_options['uploader_urlstream_upload'], 'true', false ) . ' value="true">' . __( 'TRUE', 'gmLang' ) . '</option>
474
+ <option' . selected( $gm_screen_options['uploader_urlstream_upload'], 'false', false ) . ' value="false">' . __( 'FALSE', 'gmLang' ) . '</option>
475
  </select>
476
  </div>
477
  </div>
480
  break;
481
  }
482
 
483
+ if ( $settings ) {
484
  $current = $title . $settings . $wp_screen_options . $button;
485
  }
486
 
496
  *
497
  * @return array
498
  */
499
+ function screen_settings_save( $status, $option, $value ) {
500
  global $user_ID;
501
+ if ( 'gm_screen_options' == $option ) {
502
  /*
503
  global $gmGallery;
504
  foreach ( $_POST['gm_screen_options'] as $key => $val ) {
506
  }
507
  update_option( 'gmediaOptions', $gmGallery->options );
508
  */
509
+ $gm_screen_options = get_user_meta( $user_ID, 'gm_screen_options', true );
510
+ if ( ! is_array( $gm_screen_options ) ) {
511
  $gm_screen_options = array();
512
  }
513
+ $value = array_merge( $gm_screen_options, $_POST['gm_screen_options'] );
514
 
515
  return $value;
516
  }
admin/ajax.php CHANGED
@@ -1,434 +1,513 @@
1
  <?php
2
- add_action('wp_ajax_gmedia_update_data', 'gmedia_update_data');
3
- function gmedia_update_data(){
4
  global $gmDB, $gmCore;
5
- check_ajax_referer("GmediaGallery");
6
- if(!current_user_can('gmedia_edit_media')){
7
- die('-1');
8
  }
9
 
10
- $data = $gmCore->_post('data');
11
 
12
- wp_parse_str($data, $gmedia);
13
 
14
- if(!empty($gmedia['ID'])){
15
- $item = $gmDB->get_gmedia($gmedia['ID']);
16
- if((int)$item->author != get_current_user_id()){
17
- if(!current_user_can('gmedia_edit_others_media')){
18
- die('-2');
19
  }
20
  }
21
 
22
- $gmedia['modified'] = current_time('mysql');
23
  $gmedia['mime_type'] = $item->mime_type;
24
- $gmedia['gmuid'] = $item->gmuid;
 
 
 
25
 
26
- $gmuid = pathinfo($item->gmuid);
27
 
28
- $gmedia['filename'] = preg_replace('/[^a-z0-9_\.-]+/i', '_', $gmedia['filename']);
29
- if(($gmedia['filename'] != $gmuid['filename']) && ((int)$item->author == get_current_user_id())){
30
- $fileinfo = $gmCore->fileinfo($gmedia['filename'] . '.' . $gmuid['extension']);
31
- if('image' == $fileinfo['dirname'] && file_is_displayable_image($fileinfo['dirpath'] . '/' . $item->gmuid)){
32
- @rename($fileinfo['dirpath_original'] . '/' . $item->gmuid, $fileinfo['filepath_original']);
33
- @rename($fileinfo['dirpath_thumb'] . '/' . $item->gmuid, $fileinfo['filepath_thumb']);
34
- }
35
- if(@rename($fileinfo['dirpath'] . '/' . $item->gmuid, $fileinfo['filepath'])){
36
- $gmedia['gmuid'] = $fileinfo['basename'];
 
 
37
  }
38
  }
39
- if(!current_user_can('gmedia_terms')){
40
- unset($gmedia['terms']);
41
  }
42
 
43
- $id = $gmDB->insert_gmedia($gmedia);
44
- if(!is_wp_error($id)){
45
  // Meta Stuff
46
- if(isset($gmedia['meta']) && is_array($gmedia['meta'])){
47
- foreach($gmedia['meta'] as $key => $value){
48
- if('cover' == $key){
49
- $value = ltrim($value, '#');
50
  }
51
- $gmDB->update_metadata('gmedia', $id, $key, $value);
52
  }
53
  }
54
- $result = $gmDB->get_gmedia($id);
55
- } else{
56
- $result = $gmDB->get_gmedia($id);
57
  }
58
- if(current_user_can('gmedia_terms')){
59
- $tags = $gmDB->get_the_gmedia_terms($id, 'gmedia_tag');
60
- if($tags){
61
  $tags_list = array();
62
- foreach($tags as $tag){
63
  $tags_list[] = $tag->name;
64
  }
65
- $result->tags = implode(', ', $tags_list);
 
 
 
 
 
 
 
66
  }
67
- if(!empty($gmedia['terms']['gmedia_album'])){
68
- $alb_id = (int) $gmedia['terms']['gmedia_album'];
69
- $alb = $gmDB->get_term($alb_id, 'gmedia_album');
70
- $result->album_status = $alb->status;
71
- } else{
72
- $result->album_status = 'none';
73
- }
74
  }
75
 
76
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
77
- echo json_encode($result);
78
  }
79
 
80
  die();
81
  }
82
 
83
- add_action('wp_ajax_gmedit_save', 'gmedit_save');
84
- function gmedit_save(){
85
  global $gmDB, $gmCore, $gmGallery, $gmProcessor;
86
- check_ajax_referer("gmedit-save");
87
- if(!current_user_can('gmedia_edit_media')){
88
- die('-1');
89
  }
90
 
91
- $gmedia = array();
92
- $fail = '';
93
  $success = '';
94
- $gmid = $gmCore->_post('id');
95
- $image = $gmCore->_post('image');
96
- $applyto = $gmCore->_post('applyto', 'web');
97
-
98
- $item = $gmDB->get_gmedia($gmid);
99
- if(!empty($item)){
100
- if((int)$item->author != get_current_user_id()){
101
- if(!current_user_can('gmedia_edit_others_media')){
102
- die('-2');
103
  }
104
  }
105
- $meta = $gmDB->get_metadata('gmedia', $item->ID, '_metadata', true);
106
- $gmedia['ID'] = $gmid;
107
- $gmedia['date'] = $item->date;
108
- $gmedia['modified'] = current_time('mysql');
109
- $gmedia['author'] = $item->author;
110
 
111
- $webimg = $gmGallery->options['image'];
112
  $thumbimg = $gmGallery->options['thumb'];
113
 
114
- $image = $gmCore->process_gmedit_image($image);
115
 
116
- $fileinfo = $gmCore->fileinfo($item->gmuid, false);
117
 
118
- if(!file_exists($fileinfo['filepath_original'] . '_backup')){
119
- @copy($fileinfo['filepath_original'], $fileinfo['filepath_original'] . '_backup');
120
  }
121
- rename($fileinfo['filepath_original'], $fileinfo['filepath_original'] . '.tmp');
122
- file_put_contents($fileinfo['filepath_original'], $image['data']);
123
- $size = @getimagesize($fileinfo['filepath_original']);
124
-
125
- do{
126
- $editor = wp_get_image_editor($fileinfo['filepath_original']);
127
- if(is_wp_error($editor)){
128
- @unlink($fileinfo['filepath_original']);
129
- rename($fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  $fail = $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message();
131
  break;
132
  }
133
 
134
- $webis = false;
135
  $thumbis = false;
136
  // Web-image
137
- if('web' == $applyto || 'original' == $applyto){
138
- $webimg['resize'] = (($webimg['width'] < $size[0]) || ($webimg['height'] < $size[1]))? true : false;
139
- if($webimg['resize']){
140
- $editor->set_quality($webimg['quality']);
141
- $resized = $editor->resize($webimg['width'], $webimg['height'], $webimg['crop']);
142
- if(is_wp_error($resized)){
143
- @unlink($fileinfo['filepath_original']);
144
- rename($fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original']);
145
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message();
146
  break;
147
  }
148
- if(file_exists($fileinfo['filepath'])){
149
  $webis = true;
150
- rename($fileinfo['filepath'], $fileinfo['filepath'] . '.tmp');
151
  }
152
- $saved = $editor->save($fileinfo['filepath']);
153
- if(is_wp_error($saved)){
154
- @unlink($fileinfo['filepath_original']);
155
- rename($fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original']);
156
- if($webis){
157
- rename($fileinfo['filepath'] . '.tmp', $fileinfo['filepath']);
158
  }
159
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message();
160
  break;
161
  }
162
- } else{
163
- @copy($fileinfo['filepath_original'], $fileinfo['filepath']);
164
  }
165
  }
166
 
167
  // Thumbnail
168
- $thumbimg['resize'] = (($thumbimg['width'] < $size[0]) || ($thumbimg['height'] < $size[1]))? true : false;
169
- if($thumbimg['resize']){
170
- $editor->set_quality($thumbimg['quality']);
171
- $resized = $editor->resize($thumbimg['width'], $thumbimg['height'], $thumbimg['crop']);
172
- if(is_wp_error($resized)){
173
- @unlink($fileinfo['filepath_original']);
174
- rename($fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original']);
175
- if($webis){
176
- @unlink($fileinfo['filepath']);
177
- rename($fileinfo['filepath'] . '.tmp', $fileinfo['filepath']);
178
  }
179
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})): " . $resized->get_error_message();
180
  break;
181
  }
182
 
183
- if(file_exists($fileinfo['filepath_thumb'])){
184
  $thumbis = true;
185
- rename($fileinfo['filepath_thumb'], $fileinfo['filepath_thumb'] . '.tmp');
186
  }
187
- $saved = $editor->save($fileinfo['filepath_thumb']);
188
- if(is_wp_error($saved)){
189
- @unlink($fileinfo['filepath_original']);
190
- rename($fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original']);
191
- if($webis){
192
- @unlink($fileinfo['filepath']);
193
- rename($fileinfo['filepath'] . '.tmp', $fileinfo['filepath']);
194
  }
195
- if($thumbis){
196
- rename($fileinfo['filepath_thumb'] . '.tmp', $fileinfo['filepath_thumb']);
197
  }
198
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->thumb): " . $saved->get_error_message();
199
  break;
200
  }
201
 
202
- } else{
203
- @copy($fileinfo['filepath_original'], $fileinfo['filepath']);
204
- @copy($fileinfo['filepath_original'], $fileinfo['filepath_thumb']);
205
  }
206
 
207
- if('original' !== $applyto){
208
- @unlink($fileinfo['filepath_original']);
209
- rename($fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original']);
210
- if(filesize($fileinfo['filepath_original']) === filesize($fileinfo['filepath_original'] . '_backup')){
211
- @unlink($fileinfo['filepath_original'] . '_backup');
212
  }
213
  }
214
- if(file_exists($fileinfo['filepath'] . '.tmp')){
215
- @unlink($fileinfo['filepath'] . '.tmp');
216
  }
217
- if(file_exists($fileinfo['filepath_original'] . '.tmp')){
218
- @unlink($fileinfo['filepath_original'] . '.tmp');
219
  }
220
- if(file_exists($fileinfo['filepath_thumb'] . '.tmp')){
221
- @unlink($fileinfo['filepath_thumb'] . '.tmp');
222
  }
223
 
224
- $id = $gmDB->insert_gmedia($gmedia);
225
 
226
- $metadata = $gmDB->generate_gmedia_metadata($id, $fileinfo);
227
- $meta['web'] = $metadata['web'];
228
  $meta['original'] = $metadata['original'];
229
- $meta['thumb'] = $metadata['thumb'];
230
 
231
- $gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_metadata', $meta);
232
 
233
- $success = sprintf(__('Image "%d" updated', 'gmLang'), $id);
234
- } while(0);
235
 
236
- if(empty($fail)){
237
- $out = array('msg' => $gmProcessor->alert('info', $success), 'modified' => $gmedia['modified']);
238
- } else{
239
- $out = array('error' => $gmProcessor->alert('danger', $fail));
240
  }
241
 
242
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
243
- echo json_encode($out);
244
  }
245
 
246
  die();
247
  }
248
 
249
- add_action('wp_ajax_gmedit_restore', 'gmedit_restore');
250
- function gmedit_restore(){
251
  global $gmDB, $gmCore, $gmGallery, $gmProcessor;
252
- check_ajax_referer("gmedit-save");
253
- if(!current_user_can('gmedia_edit_media')){
254
- die('-1');
255
  }
256
 
257
- $gmedia = array();
258
- $fail = '';
259
  $success = '';
260
- $gmid = $gmCore->_post('id');
261
 
262
- $item = $gmDB->get_gmedia($gmid);
263
- if(!empty($item)){
264
- if((int)$item->author != get_current_user_id()){
265
- if(!current_user_can('gmedia_edit_others_media')){
266
- die('-2');
267
  }
268
  }
269
- $meta = $gmDB->get_metadata('gmedia', $item->ID, '_metadata', true);
270
- $gmedia['ID'] = $gmid;
271
- $gmedia['date'] = $item->date;
272
- $gmedia['modified'] = current_time('mysql');
273
- $gmedia['author'] = $item->author;
274
 
275
- $webimg = $gmGallery->options['image'];
276
  $thumbimg = $gmGallery->options['thumb'];
277
 
278
- $fileinfo = $gmCore->fileinfo($item->gmuid, false);
279
 
280
- if(file_exists($fileinfo['filepath_original'] . '_backup')){
281
- rename($fileinfo['filepath_original'] . '_backup', $fileinfo['filepath_original']);
282
  }
283
- $size = @getimagesize($fileinfo['filepath_original']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
 
285
- do{
286
- $editor = wp_get_image_editor($fileinfo['filepath_original']);
287
- if(is_wp_error($editor)){
288
  $fail = $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message();
289
  break;
290
  }
291
 
292
- $thumbimg['resize'] = (($thumbimg['width'] < $size[0]) || ($thumbimg['height'] < $size[1]))? true : false;
293
- if($thumbimg['resize']){
294
 
295
- $webimg['resize'] = (($webimg['width'] < $size[0]) || ($webimg['height'] < $size[1]))? true : false;
296
- if($webimg['resize']){
297
  // Web-image
298
- $editor->set_quality($webimg['quality']);
299
- $resized = $editor->resize($webimg['width'], $webimg['height'], $webimg['crop']);
300
- if(is_wp_error($resized)){
301
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message();
302
  break;
303
  }
304
 
305
- $saved = $editor->save($fileinfo['filepath']);
306
- if(is_wp_error($saved)){
307
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message();
308
  break;
309
  }
310
- } else{
311
- @copy($fileinfo['filepath_original'], $fileinfo['filepath']);
312
  }
313
 
314
  // Thumbnail
315
- $editor->set_quality($thumbimg['quality']);
316
- $resized = $editor->resize($thumbimg['width'], $thumbimg['height'], $thumbimg['crop']);
317
- if(is_wp_error($resized)){
318
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})): " . $resized->get_error_message();
319
  break;
320
  }
321
 
322
- $saved = $editor->save($fileinfo['filepath_thumb']);
323
- if(is_wp_error($saved)){
324
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->thumb): " . $saved->get_error_message();
325
  break;
326
  }
327
 
328
- } else{
329
- @copy($fileinfo['filepath_original'], $fileinfo['filepath']);
330
- @copy($fileinfo['filepath_original'], $fileinfo['filepath_thumb']);
331
  }
332
 
333
- $id = $gmDB->insert_gmedia($gmedia);
334
 
335
- $metadata = $gmDB->generate_gmedia_metadata($id, $fileinfo);
336
- $meta['web'] = $metadata['web'];
337
  $meta['original'] = $metadata['original'];
338
- $meta['thumb'] = $metadata['thumb'];
339
 
340
- $gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_metadata', $meta);
341
 
342
- $success = sprintf(__('Image "%d" restored from backup and saved', 'gmLang'), $id);
343
- } while(0);
344
 
345
- if(empty($fail)){
346
- $out = array('msg' => $gmProcessor->alert('info', $success), 'modified' => $gmedia['modified']);
347
- } else{
348
- $out = array('error' => $gmProcessor->alert('danger', $fail));
349
  }
350
 
351
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
352
- echo json_encode($out);
353
  }
354
 
355
  die();
356
  }
357
 
358
- add_action('wp_ajax_gmedia_get_modal', 'gmedia_get_modal');
359
- function gmedia_get_modal(){
360
  global $gmDB, $gmCore, $gmGallery;
361
- check_ajax_referer("GmediaGallery");
362
- $user_ID = get_current_user_id();
363
  $button_class = 'btn-primary';
364
- $gm_terms = array();
365
- $modal = $gmCore->_post('modal');
366
- switch($modal){
367
  case 'quick_gallery':
368
- if(!current_user_can('gmedia_gallery_manage')){
369
- die('-1');
370
  }
371
- $modal_title = __('Quick Gallery from selected items', 'gmLang');
372
- $modal_button = __('Create Quick Gallery', 'gmLang');
373
  break;
374
  case 'filter_categories':
375
- $modal_title = __('Show Images from Categories', 'gmLang');
376
- $modal_button = __('Show Selected', 'gmLang');
377
  break;
378
  case 'assign_category':
379
- if(!current_user_can('gmedia_terms')){
380
- die('-1');
381
  }
382
- $modal_title = __('Assign Category for Selected Images', 'gmLang');
383
- $modal_button = __('Assign Category', 'gmLang');
384
  break;
385
  case 'filter_albums':
386
- $modal_title = __('Filter Albums', 'gmLang');
387
- $modal_button = __('Show Selected', 'gmLang');
388
  break;
389
  case 'assign_album':
390
- if(!current_user_can('gmedia_terms')){
391
- die('-1');
392
  }
393
- $modal_title = __('Assign Album for Selected Items', 'gmLang');
394
- $modal_button = __('Assign Album', 'gmLang');
395
  break;
396
  case 'filter_tags':
397
- $modal_title = __('Filter by Tags', 'gmLang');
398
- $modal_button = __('Show Selected', 'gmLang');
399
  break;
400
  case 'add_tags':
401
- if(!current_user_can('gmedia_terms')){
402
- die('-1');
403
  }
404
- $modal_title = __('Add Tags to Selected Items', 'gmLang');
405
- $modal_button = __('Add Tags', 'gmLang');
406
  break;
407
  case 'delete_tags':
408
- if(!current_user_can('gmedia_terms')){
409
- die('-1');
410
  }
411
  $button_class = 'btn-danger';
412
- $modal_title = __('Delete Tags from Selected Items', 'gmLang');
413
- $modal_button = __('Delete Tags', 'gmLang');
414
  break;
415
  case 'filter_authors':
416
- $modal_title = __('Filter by Author', 'gmLang');
417
- if($gmCore->caps['gmedia_show_others_media']){
418
- $modal_button = __('Show Selected', 'gmLang');
419
- } else{
420
  $modal_button = false;
421
  }
422
  break;
423
  case 'batch_edit':
424
- if(!current_user_can('gmedia_edit_media')){
425
- die('-1');
426
  }
427
- $modal_title = __('Batch Edit', 'gmLang');
428
- $modal_button = __('Batch Save', 'gmLang');
429
  break;
430
  default:
431
- $modal_title = ' ';
432
  $modal_button = false;
433
  break;
434
  }
@@ -440,450 +519,465 @@ function gmedia_get_modal(){
440
  </div>
441
  <div class="modal-body">
442
  <?php
443
- switch($modal){
444
- case 'quick_gallery':
445
- global $user_ID;
446
- $ckey = "gmuser_{$user_ID}_library";
447
- $selected = isset($_COOKIE[$ckey])? $_COOKIE[$ckey] : '';
448
- if(empty($selected)){
449
- _e('No selected Gmedia. Select at least one item in library.', 'gmLang');
450
- break;
451
- }
452
- $modules = array();
453
- if(($plugin_modules = glob(GMEDIA_ABSPATH . 'module/*', GLOB_ONLYDIR | GLOB_NOSORT))){
454
- foreach($plugin_modules as $path){
455
- $mfold = basename($path);
456
- $modules[$mfold] = array(
457
- 'place' => 'plugin',
458
- 'module_name' => $mfold,
459
- 'module_url' => "{$gmCore->gmedia_url}/module/{$mfold}",
460
- 'module_path' => $path
461
- );
462
- }
463
- }
464
- if(($upload_modules = glob($gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/*', GLOB_ONLYDIR | GLOB_NOSORT))){
465
- foreach($upload_modules as $path){
466
- $mfold = basename($path);
467
- $modules[$mfold] = array(
468
- 'place' => 'upload',
469
- 'module_name' => $mfold,
470
- 'module_url' => "{$gmCore->upload['url']}/{$gmGallery->options['folder']['module']}/{$mfold}",
471
- 'module_path' => $path
472
- );
473
- }
474
- }
475
- ?>
476
- <div class="form-group">
477
- <label><?php _e('Gallery Name', 'gmLang'); ?></label>
478
- <input type="text" class="form-control input-sm" name="gallery[name]" placeholder="<?php echo esc_attr(__('Gallery Name', 'gmLang')); ?>" value="" required="required"/>
479
- </div>
480
- <div class="form-group">
481
- <label><?php _e('Modue', 'gmLang'); ?></label>
482
- <select class="form-control input-sm" name="gallery[module]">
483
- <?php
484
- if(!empty($modules)){
485
- foreach($modules as $m){
486
- /**
487
- * @var $module_name
488
- * @var $module_url
489
- * @var $module_path
490
- */
491
- extract($m);
492
- if(!file_exists($module_path . '/index.php')){
493
- continue;
494
- }
495
- $module_info = array();
496
- include($module_path . '/index.php');
497
- if(empty($module_info)){
498
- continue;
499
- }
500
- ?>
501
- <option value="<?php echo $module_name; ?>"><?php echo $module_info['title']; ?></option>
502
- <?php
503
- }
504
- }
505
- ?>
506
- </select>
507
- </div>
508
- <div class="form-group">
509
- <label><?php _e('Selected IDs', 'gmLang'); ?></label>
510
- <input type="text" name="gallery[query][gmedia__in][]" class="form-control input-sm" value="<?php echo $selected; ?>" required="required"/>
511
- </div>
512
- <?php
513
  break;
514
- case 'filter_categories':
515
- $gm_terms = $gmDB->get_terms('gmedia_category');
516
- ?>
517
- <div class="checkbox"><label><input type="checkbox" name="cat[]" value="0"> <?php _e('Uncategorized', 'gmLang'); ?></label></div>
518
- <?php if(count($gm_terms)){
519
- foreach($gm_terms as $term){
520
- if($term->count){
521
- ?>
522
- <div class="checkbox">
523
- <label><input type="checkbox" name="cat[]" value="<?php echo $term->term_id; ?>"> <?php echo esc_html($term->name); ?></label>
524
- <span class="badge pull-right"><?php echo $term->count; ?></span>
525
- </div>
526
- <?php
527
- }
528
- }
529
  }
530
- break;
531
- case 'assign_category':
532
- $term_type = 'gmedia_category';
533
- $gm_terms = $gmGallery->options['taxonomies'][$term_type];
534
- ?>
535
- <div class="radio"><label><input type="radio" name="cat" value="0"> <?php _e('Uncategorized', 'gmLang'); ?></label></div>
536
- <?php if(count($gm_terms)){
537
- foreach($gm_terms as $term_name => $term_title){
538
- echo '<div class="radio"><label><input type="radio" name="cat" value="' . $term_name . '"> ' . esc_html($term_title) . '</label></div>';
 
539
  }
540
  }
541
- break;
542
- case 'filter_albums':
543
- if($gmCore->caps['gmedia_show_others_media']){
544
- $args = array();
545
- } else{
546
- $args = array(
547
- 'global' => array(0, $user_ID),
548
- 'orderby' => 'global_desc_name'
549
  );
550
  }
551
- $gm_terms = $gmDB->get_terms('gmedia_album', $args);
552
- ?>
553
- <div class="checkbox"><label><input type="checkbox" name="alb[]" value="0"> <?php _e('No Album', 'gmLang'); ?></label></div>
554
- <hr/>
555
- <?php if(count($gm_terms)){
556
- foreach($gm_terms as $term){
557
- $author_name = '';
558
- if($term->global){
559
- if($gmCore->caps['gmedia_show_others_media']){
560
- $author_name .= sprintf(__('by %s', 'gmLang'), get_the_author_meta('display_name', $term->global));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  }
562
- } else{
563
- $author_name .= '(' . __('shared', 'gmLang') . ')';
564
- }
565
- if ('public' != $term->status) {
566
- $author_name .= ' [' . $term->status . ']';
567
- }
568
- if($author_name){
569
- $author_name = " <small>{$author_name}</small>";
570
  }
571
  ?>
572
- <div class="checkbox">
573
- <label><input type="checkbox" name="alb[]" value="<?php echo $term->term_id; ?>"> <?php echo esc_html($term->name) . $author_name; ?></label>
574
- <span class="badge pull-right"><?php echo $term->count; ?></span>
575
- </div>
576
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  }
578
- } else{
579
- $modal_button = false;
580
  }
581
- break;
582
- case 'assign_album':
583
- if($gmCore->caps['gmedia_edit_others_media']){
584
- $args = array();
585
- } else{
586
- $args = array(
587
- 'global' => array(0, $user_ID),
588
- 'orderby' => 'global_desc_name'
589
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
590
  }
591
- $gm_terms = $gmDB->get_terms('gmedia_album', $args);
592
-
593
- $terms_album = '';
594
- if(count($gm_terms)){
595
- foreach($gm_terms as $term){
596
- $author_name = '';
597
- if($term->global){
598
- if($gmCore->caps['gmedia_edit_others_media']){
599
- $author_name .= ' &nbsp; ' . sprintf(__('by %s', 'gmLang'), get_the_author_meta('display_name', $term->global));
600
- }
601
- } else{
602
- $author_name .= ' &nbsp; (' . __('shared', 'gmLang') . ')';
603
- }
604
- if ('public' != $term->status) {
605
- $author_name .= ' [' . $term->status . ']';
606
- }
607
- $terms_album .= '<option value="' . $term->term_id . '" data-count="' . $term->count . '" data-name="' . esc_html($term->name) . '" data-meta="' . $author_name . '">' . esc_html($term->name) . $author_name . '</option>' . "\n";
608
- }
609
- }
610
- ?>
611
- <div class="form-group">
612
- <label><?php _e('Move to Album', 'gmLang'); ?> </label>
613
- <select id="combobox_gmedia_album" name="alb" class="form-control" placeholder="<?php _e('Album Name...', 'gmLang'); ?>">
614
- <option></option>
615
- <option value="0"><?php _e('No Album', 'gmLang'); ?></option>
616
- <?php echo $terms_album; ?>
617
- </select>
618
- </div>
619
- <div class="form-group">
620
- <div class="checkbox"><label><input type="checkbox" name="status_global" value="1" checked> <?php _e('Make status of selected items be the same as Album status', 'gmLang'); ?></label></div>
621
- </div>
622
- <script type="text/javascript">
623
- jQuery(function($){
624
- var albums = $('#combobox_gmedia_album');
625
- var albums_data = $('option', albums);
626
- albums.selectize({
627
- <?php if($gmCore->caps['gmedia_album_manage']){ ?>
628
- create: function(input){
629
- return {
630
- value: input,
631
- text: input
632
- }
633
- },
634
- createOnBlur: true,
635
- <?php } else{ ?>
636
- create: false,
637
- <?php } ?>
638
- persist: false,
639
- render: {
640
- item: function(item, escape){
641
- if(0 === (parseInt(item.value, 10) || 0)){
642
- return '<div>' + escape(item.text) + '</div>';
643
- }
644
- if(item.$order) {
645
- var data = $(albums_data[item.$order]).data();
646
- return '<div>' + escape(data.name) + ' <small>' + escape(data.meta) + '</small></div>';
647
- }
648
- },
649
- option: function(item, escape){
650
- if(0 === (parseInt(item.value) || 0)){
651
- return '<div>' + escape(item.text) + '</div>';
652
- }
653
- if(item.$order) {
654
- var data = $(albums_data[item.$order]).data();
655
- return '<div>' + escape(data.name) + ' <small>' + escape(data.meta) + '</small>' + ' <span class="badge pull-right">' + escape(data.count) + '</span></div>';
656
- }
657
- }
658
- }
659
-
660
- });
661
- });
662
- </script>
663
- <?php
664
- break;
665
- case 'filter_tags':
666
- $gm_terms = $gmDB->get_terms('gmedia_tag', array('fields' => 'names_count'));
667
- $gm_terms = array_values($gm_terms);
668
- if(count($gm_terms)){
669
- ?>
670
- <div class="form-group">
671
- <input id="combobox_gmedia_tag" name="tag_ids" class="form-control input-sm" value="" placeholder="<?php _e('Filter Tags...', 'gmLang'); ?>"/></div>
672
- <script type="text/javascript">
673
- jQuery(function($){
674
- var gm_terms = <?php echo json_encode($gm_terms); ?>;
675
- var items = gm_terms.map(function(x){
676
- return { id: x.term_id, name: x.name, count: x.count };
677
- });
678
- $('#combobox_gmedia_tag').selectize({
679
- delimiter: ',',
680
- maxItems: null,
681
- openOnFocus: true,
682
- labelField: 'name',
683
- hideSelected: true,
684
- options: items,
685
- searchField: ['name'],
686
- valueField: 'id',
687
- create: false,
688
- render: {
689
- item: function(item, escape){
690
- return '<div>' + escape(item.name) + '</div>';
691
- },
692
- option: function(item, escape){
693
- return '<div>' + escape(item.name) + ' <span class="badge">' + escape(item.count) + '</span></div>';
694
- }
695
- }
696
- });
697
- });
698
- </script>
699
- <?php
700
- } else{
701
- $modal_button = false; ?>
702
- <p class="notags"><?php _e('No tags', 'gmLang'); ?></p>
703
- <?php
704
  }
705
- break;
706
- case 'add_tags':
707
- $gm_terms = $gmDB->get_terms('gmedia_tag', array('fields' => 'names_count'));
708
- $gm_terms = array_values($gm_terms);
709
- if(count($gm_terms)){
710
- ?>
711
- <div class="form-group">
712
- <input id="combobox_gmedia_tag" name="tag_names" class="form-control input-sm" value="" placeholder="<?php _e('Add Tags...', 'gmLang'); ?>"/></div>
713
- <script type="text/javascript">
714
- jQuery(function($){
715
- var gm_terms = <?php echo json_encode($gm_terms); ?>;
716
- var items = gm_terms.map(function(x){
717
- return { id: x.term_id, name: x.name, count: x.count };
718
- });
719
- $('#combobox_gmedia_tag').selectize({
720
- delimiter: ',',
721
- maxItems: null,
722
- openOnFocus: false,
723
- labelField: 'name',
724
- hideSelected: true,
725
- options: items,
726
- searchField: ['name'],
727
- valueField: 'name',
728
- persist: false,
729
- <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
730
- createOnBlur: true,
731
- create: function(input){
732
- return {
733
- name: input
734
- }
735
- },
736
- <?php } else{ ?>
737
- create: false,
738
- <?php } ?>
739
- render: {
740
- item: function(item, escape){
741
- return '<div>' + escape(item.name) + '</div>';
742
- },
743
- option: function(item, escape){
744
- return '<div>' + escape(item.name) + ' <span class="badge">' + escape(item.count) + '</span></div>';
745
- }
746
  }
747
- });
748
- });
749
- </script>
750
- <?php
751
- } else{
752
- $modal_button = false; ?>
753
- <p class="notags"><?php _e('No tags', 'gmLang'); ?></p>
754
- <?php
755
- }
756
- break;
757
- case 'delete_tags':
758
- global $gmProcessor;
759
- if(!empty($gmProcessor->selected_items)){
760
- $gm_terms = $gmDB->get_gmedia_terms($gmProcessor->selected_items, 'gmedia_tag');
761
- }
762
- if(count($gm_terms)){
763
- foreach($gm_terms as $term){
764
- ?>
765
- <div class="checkbox">
766
- <label><input type="checkbox" name="tag_id[]" value="<?php echo $term->term_id; ?>"> <?php echo esc_html($term->name); ?></label>
767
- <span class="badge pull-right"><?php echo $term->count; ?></span>
768
- </div>
769
- <?php
770
- }
771
- } else{
772
- $modal_button = false; ?>
773
- <p class="notags"><?php _e('No tags', 'gmLang'); ?></p>
774
- <?php
775
- }
776
- break;
777
- case 'filter_authors':
778
- if($gmCore->caps['gmedia_show_others_media']){
779
- ?>
780
- <div class="form-group">
781
- <label><?php _e('Choose Author', 'gmLang'); ?></label>
782
- <?php
783
- $user_ids = $gmCore->get_editable_user_ids();
784
- if($user_ids){
785
- wp_dropdown_users(array(
786
- 'show_option_all' => ' &#8212; ',
787
- 'include' => $user_ids,
788
- 'include_selected' => true,
789
- 'name' => 'author_ids',
790
- 'selected' => $user_ID,
791
- 'class' => 'form-control'
792
- ));
793
- } else{
794
- echo '<div>' . get_the_author_meta('display_name', $user_ID) . '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
795
  }
796
- ?>
797
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
798
  <?php
799
- } else{
800
- echo '<p>' . __('You are not allowed to see others media') . '</p>';
801
- echo '<p><strong>' . get_the_author_meta('display_name', $user_ID) . '</strong></p>';
 
 
 
 
 
 
 
 
 
 
 
 
802
  }
803
- break;
804
- case 'batch_edit':
805
  ?>
806
- <p><?php _e('Note, data will be saved to all selected items in Gmedia Library.') ?></p>
807
- <div class="form-group">
808
- <label><?php _e('Title', 'gmLang'); ?></label>
809
- <select class="form-control input-sm batch_set" name="batch_title">
810
- <option value=""><?php _e('Skip. Do not change', 'gmLang'); ?></option>
811
- <option value="empty"><?php _e('Empty Title', 'gmLang'); ?></option>
812
- <option value="filename"><?php _e('From Filename', 'gmLang'); ?></option>
813
- <option value="custom"><?php _e('Custom', 'gmLang'); ?></option>
814
- </select>
815
- <input class="form-control input-sm batch_set_custom" style="margin-top:5px;display:none;" name="batch_title_custom" value="" placeholder="<?php _e('Enter custom title here'); ?>" />
816
- </div>
817
- <div class="form-group">
818
- <label><?php _e('Description', 'gmLang'); ?></label>
819
- <select class="form-control input-sm batch_set" name="batch_description">
820
- <option value=""><?php _e('Skip. Do not change', 'gmLang'); ?></option>
821
- <option value="empty"><?php _e('Empty Description', 'gmLang'); ?></option>
822
- <option value="custom"><?php _e('Custom', 'gmLang'); ?></option>
823
- </select>
824
- <textarea class="form-control input-sm batch_set_custom" style="margin-top:5px;display:none;" cols="30" rows="3" name="batch_description_custom" placeholder="<?php _e('Enter description here'); ?>"></textarea>
825
- </div>
826
- <div class="form-group">
827
- <label><?php _e('Link', 'gmLang'); ?></label>
828
- <select class="form-control input-sm batch_set" name="batch_link">
829
- <option value=""><?php _e('Skip. Do not change', 'gmLang'); ?></option>
830
- <option value="empty"><?php _e('Empty Link', 'gmLang'); ?></option>
831
- <option value="self"><?php _e('Link to original file', 'gmLang'); ?></option>
832
- <option value="custom"><?php _e('Custom', 'gmLang'); ?></option>
833
- </select>
834
- <input class="form-control input-sm batch_set_custom" style="margin-top:5px;display:none;" name="batch_link_custom" value="" placeholder="<?php _e('Enter url here'); ?>" />
835
- </div>
836
- <div class="form-group">
837
- <label><?php _e('Status', 'gmLang'); ?></label>
838
- <select class="form-control input-sm batch_set" name="batch_status">
839
- <option value=""><?php _e('Skip. Do not change', 'gmLang'); ?></option>
840
- <option value="public"><?php _e('Public', 'gmLang'); ?></option>
841
- <option value="private"><?php _e('Private', 'gmLang'); ?></option>
842
- <option value="draft"><?php _e('Draft', 'gmLang'); ?></option>
843
  </select>
 
844
  </div>
845
- <?php $user_ids = $gmCore->get_editable_user_ids();
846
- if($user_ids){
847
- ?>
848
- <div class="form-group">
849
- <label><?php _e('Author', 'gmLang'); ?></label>
850
- <?php wp_dropdown_users(array(
851
- 'show_option_none' => __('Skip. Do not change', 'gmLang'),
852
- 'include' => $user_ids,
853
- 'include_selected' => true,
854
- 'name' => 'batch_author',
855
- 'selected' => -1,
856
- 'class' => 'input-sm form-control'
857
- ));
858
- ?>
859
- </div>
860
- <?php } ?>
861
- <script type="text/javascript">
862
- jQuery(function($){
863
- $('select.batch_set').change(function(){
864
- if('custom' == $(this).val()){
865
- $(this).next().css({display:'block'});
866
- } else{
867
- $(this).next().css({display:'none'});
868
- }
869
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
870
  });
871
- </script>
872
- <?php
873
- break;
 
874
  default:
875
- _e('Ops! Something wrong.', 'gmLang');
876
  break;
877
  }
878
  ?>
879
  </div>
880
  <div class="modal-footer">
881
- <button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Cancel', 'gmLang'); ?></button>
882
- <?php if($modal_button){ ?>
883
- <input type="hidden" name="<?php echo $modal; ?>" />
884
  <button type="button" onclick="jQuery('#ajax-modal-form').submit()" name="<?php echo $modal; ?>" class="btn <?php echo $button_class; ?>"><?php echo $modal_button; ?></button>
885
- <?php }
886
- wp_nonce_field('gmedia_modal');
 
887
  ?>
888
  </div>
889
  </form><!-- /.modal-content -->
@@ -891,90 +985,128 @@ function gmedia_get_modal(){
891
  die();
892
  }
893
 
894
- add_action('wp_ajax_gmedia_tag_edit', 'gmedia_tag_edit');
895
- function gmedia_tag_edit(){
896
  global $gmCore, $gmDB, $gmProcessor;
897
 
898
- check_ajax_referer('GmediaTerms');
899
- if(!current_user_can('gmedia_tag_manage')){
900
- die('-1');
 
 
 
901
  }
902
 
903
- $term = array('taxonomy' => 'gmedia_tag');
904
- $term['name'] = trim($gmCore->_post('tag_name', ''));
905
- $term['term_id'] = intval($gmCore->_post('tag_id', 0));
906
- if($term['name'] && !$gmCore->is_digit($term['name'])){
907
- if(($term_id = $gmDB->term_exists($term['term_id'], $term['taxonomy']))){
908
- if(!$gmDB->term_exists($term['name'], $term['taxonomy'])){
909
- $term_id = $gmDB->update_term($term['term_id'], $term['taxonomy'], $term);
910
- if(is_wp_error($term_id)){
911
- $out['error'] = $gmProcessor->alert('danger', $term_id->get_error_message());
912
- } else{
913
- $out['msg'] = $gmProcessor->alert('info', sprintf(__("Tag #%d successfuly updated", 'gmLang'), $term_id));
914
  }
915
- } else{
916
- $out['error'] = $gmProcessor->alert('danger', __("A term with the name provided already exists", 'gmLang'));
917
  }
918
- } else{
919
- $out['error'] = $gmProcessor->alert('danger', __("A term with the id provided do not exists", 'gmLang'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
920
  }
921
- } else{
922
- $out['error'] = $gmProcessor->alert('danger', __("Term name can't be only digits or empty", 'gmLang'));
923
  }
924
 
925
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
926
- echo json_encode($out);
927
 
928
  die();
929
 
930
  }
931
 
932
- add_action('wp_ajax_gmedia_module_install', 'gmedia_module_install');
933
- function gmedia_module_install(){
934
  global $gmCore, $gmProcessor, $gmGallery;
935
 
936
- check_ajax_referer('GmediaModule');
937
- if(!current_user_can('gmedia_module_manage')){
938
- echo $gmProcessor->alert('danger', __('You are not allowed to install modules'));
939
  die();
940
  }
941
 
942
- if(($download = $gmCore->_post('download'))){
943
- $module = $gmCore->_post('module');
944
- $mzip = download_url($download);
945
- if(is_wp_error($mzip)){
946
- echo $gmProcessor->alert('danger', $mzip->get_error_message());
947
  die();
948
  }
949
 
950
- $mzip = str_replace("\\", "/", $mzip);
951
  $to_folder = $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/';
 
 
 
 
 
 
 
 
 
 
 
952
 
953
  global $wp_filesystem;
954
  // Is a filesystem accessor setup?
955
- if(!$wp_filesystem || !is_object($wp_filesystem)){
956
- require_once(ABSPATH . 'wp-admin/includes/file.php');
957
  WP_Filesystem();
958
  }
959
- if(!is_object($wp_filesystem)){
960
- $result = new WP_Error('fs_unavailable', __('Could not access filesystem.', 'flag'));
961
- } elseif($wp_filesystem->errors->get_error_code()){
962
- $result = new WP_Error('fs_error', __('Filesystem error', 'flag'), $wp_filesystem->errors);
963
- } else{
964
- $result = unzip_file($mzip, $to_folder);
965
  }
966
 
967
  // Once extracted, delete the package
968
- unlink($mzip);
969
 
970
- if(is_wp_error($result)){
971
- echo $gmProcessor->alert('danger', $result->get_error_message());
972
  die();
973
- } else{
974
- echo $gmProcessor->alert('success', sprintf(__("The `%s` module successfuly installed", 'flag'), $module));
975
  }
976
- } else{
977
- echo $gmProcessor->alert('danger', __('No file specified', 'gmLang'));
978
  }
979
 
980
  die();
@@ -982,47 +1114,47 @@ function gmedia_module_install(){
982
  }
983
 
984
 
985
- add_action('wp_ajax_gmedia_import_modal', 'gmedia_import_modal');
986
- function gmedia_import_modal(){
987
  global $user_ID, $gmDB, $gmCore, $gmGallery;
988
 
989
- check_ajax_referer('GmediaGallery');
990
- if(!current_user_can('gmedia_import')){
991
- die('-1');
992
  }
993
 
994
  ?>
995
  <div class="modal-content">
996
  <div class="modal-header">
997
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
998
- <h4 class="modal-title"><?php _e('Import from WP Media Library'); ?></h4>
999
  </div>
1000
  <div class="modal-body" style="position:relative; min-height:270px;">
1001
  <form id="import_form" name="import_form" target="import_window" action="<?php echo $gmCore->gmedia_url; ?>/admin/import.php" method="POST" accept-charset="utf-8">
1002
- <?php wp_nonce_field('GmediaImport'); ?>
1003
- <input type="hidden" id="import-action" name="import" value="<?php echo esc_attr($gmCore->_post('modal', '')); ?>"/>
1004
  <input type="hidden" name="selected" value="<?php $ckey = "gmuser_{$user_ID}_wpmedia";
1005
- if(isset($_COOKIE[$ckey])){
1006
- echo $_COOKIE[$ckey];
1007
  } ?>"/>
1008
- <?php if($gmCore->caps['gmedia_terms']){ ?>
1009
  <div class="form-group">
1010
  <?php
1011
  $term_type = 'gmedia_category';
1012
- $gm_terms = $gmGallery->options['taxonomies'][$term_type];
1013
 
1014
  $terms_category = '';
1015
- if(count($gm_terms)){
1016
- foreach($gm_terms as $term_name => $term_title){
1017
- $terms_category .= '<option value="' . $term_name . '">' . esc_html($term_title) . '</option>' . "\n";
1018
  }
1019
  }
1020
  ?>
1021
- <label><?php _e('Assign Category', 'gmLang'); ?>
1022
- <small><?php _e('(for images only)') ?></small>
1023
  </label>
1024
  <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
1025
- <option value=""><?php _e('Uncategorized', 'gmLang'); ?></option>
1026
  <?php echo $terms_category; ?>
1027
  </select>
1028
  </div>
@@ -1030,17 +1162,17 @@ function gmedia_import_modal(){
1030
  <div class="form-group">
1031
  <?php
1032
  $term_type = 'gmedia_album';
1033
- $gm_terms = $gmDB->get_terms($term_type, array('global' => array(0, $user_ID), 'orderby' => 'global_desc_name'));
1034
 
1035
  $terms_album = '';
1036
- if(count($gm_terms)){
1037
- foreach($gm_terms as $term){
1038
- $terms_album .= '<option value="' . esc_attr($term->term_id) . '">' . esc_html($term->name) . ($term->global? '' : __(' (shared)', 'gmLang')) . ('public' == $term->status? '' : " [{$term->status}]") . '</option>' . "\n";
1039
  }
1040
  }
1041
  ?>
1042
- <label><?php _e('Add to Album', 'gmLang'); ?> </label>
1043
- <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e('Album Name...', 'gmLang'); ?>">
1044
  <option value=""></option>
1045
  <?php echo $terms_album; ?>
1046
  </select>
@@ -1049,17 +1181,17 @@ function gmedia_import_modal(){
1049
  <div class="form-group">
1050
  <?php
1051
  $term_type = 'gmedia_tag';
1052
- $gm_terms = $gmDB->get_terms($term_type, array('fields' => 'names'));
1053
  ?>
1054
- <label><?php _e('Add Tags', 'gmLang'); ?> </label>
1055
- <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e('Add Tags...', 'gmLang'); ?>"/>
1056
  </div>
1057
- <?php } else{ ?>
1058
- <p><?php _e('You are not allowed to assign terms', 'gmLang') ?></p>
1059
  <?php } ?>
1060
 
1061
  <script type="text/javascript">
1062
- jQuery(function($){
1063
  <?php if($gmCore->caps['gmedia_terms']){ ?>
1064
  $('#combobox_gmedia_album').selectize({
1065
  <?php if($gmCore->caps['gmedia_album_manage']){ ?>
@@ -1071,12 +1203,12 @@ function gmedia_import_modal(){
1071
  persist: false
1072
  });
1073
  var gm_terms = <?php echo json_encode($gm_terms); ?>;
1074
- var items = gm_terms.map(function(x){
1075
- return { item: x };
1076
  });
1077
  $('#combobox_gmedia_tag').selectize({
1078
  <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
1079
- create: function(input){
1080
  return {
1081
  item: input
1082
  }
@@ -1096,11 +1228,11 @@ function gmedia_import_modal(){
1096
  });
1097
  <?php } ?>
1098
 
1099
- $('#import-done').one('click', function(e){
1100
  $('#import_form').submit();
1101
- $(this).button('loading').prop('disabled', true);
1102
  $('#import_window').show();
1103
- $(this).one('click', function(e){
1104
  $('#importModal').modal('hide');
1105
  });
1106
  });
@@ -1111,15 +1243,15 @@ function gmedia_import_modal(){
1111
  <iframe name="import_window" id="import_window" src="about:blank" style="display:none; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1000; background-color:#ffffff; padding:20px 20px 0 20px;" onload="gmedia_import_done()"></iframe>
1112
  </div>
1113
  <div class="modal-footer">
1114
- <button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Cancel', 'gmLang'); ?></button>
1115
- <button type="button" id="import-done" class="btn btn-primary" data-complete-text="<?php _e('Close', 'gmLang'); ?>" data-loading-text="<?php _e('Working...', 'gmLang'); ?>"><?php _e('Import', 'gmLang'); ?></button>
1116
  </div>
1117
  </div><!-- /.modal-content -->
1118
  <?php
1119
  die();
1120
  }
1121
 
1122
- add_action('wp_ajax_gmedia_relimage', 'gmedia_relimage');
1123
  /**
1124
  * Do Actions via Ajax
1125
  * TODO add related images to post
@@ -1127,100 +1259,100 @@ add_action('wp_ajax_gmedia_relimage', 'gmedia_relimage');
1127
  *
1128
  * @return void
1129
  */
1130
- function gmedia_relimage(){
1131
  /** @var $wpdb wpdb */
1132
  global $wpdb, $gmCore, $gmDB;
1133
 
1134
- check_ajax_referer("grandMedia");
1135
 
1136
  // check for correct capability
1137
- if(!current_user_can('gmedia_library')){
1138
- die('-1');
1139
  }
1140
 
1141
- $post_tags = array_filter(array_map('trim', explode(',', stripslashes(urldecode($gmCore->_get('tags', ''))))));
1142
- $paged = (int)$gmCore->_get('paged', 1);
1143
- $per_page = 20;
1144
- $s = trim(stripslashes(urldecode($gmCore->_get('search'))));
1145
- if($s && strlen($s) > 2){
1146
  $post_tags = array();
1147
- } else{
1148
  $s = '';
1149
  }
1150
 
1151
  $gmediaLib = array();
1152
- $relative = (int)$gmCore->_get('rel', 1);
1153
- $continue = true;
1154
- $content = '';
1155
-
1156
- if($relative == 1){
1157
- $arg = array(
1158
- 'mime_type' => 'image/*',
1159
- 'orderby' => 'ID',
1160
- 'order' => 'DESC',
1161
- 'per_page' => $per_page,
1162
- 'page' => $paged,
1163
- 's' => $s,
1164
  'tag_name__in' => $post_tags,
1165
- 'null_tags' => true
1166
  );
1167
- $gmediaLib = $gmDB->get_gmedias($arg);
1168
  }
1169
 
1170
- if(empty($gmediaLib) && count($post_tags)){
1171
 
1172
- if($relative == 1){
1173
  $relative = 0;
1174
- $paged = 1;
1175
- $content .= '<li class="emptydb">' . __('No items related by tags.', 'gmLang') . '</li>' . "\n";
1176
  }
1177
 
1178
- $tag__not_in = "'" . implode("','", array_map('esc_sql', array_unique((array)$post_tags))) . "'";
1179
- $tag__not_in = $wpdb->get_col("
1180
  SELECT term_id
1181
  FROM {$wpdb->prefix}gmedia_term
1182
  WHERE taxonomy = 'gmedia_tag'
1183
  AND name IN ({$tag__not_in})
1184
- ");
1185
-
1186
- $arg = array(
1187
- 'mime_type' => 'image/*',
1188
- 'orderby' => 'ID',
1189
- 'order' => 'DESC',
1190
- 'per_page' => $per_page,
1191
- 'page' => $paged,
1192
  'tag__not_in' => $tag__not_in
1193
  );
1194
- $gmediaLib = $gmDB->get_gmedias($arg);
1195
  }
1196
 
1197
- if(($count = count($gmediaLib))){
1198
- foreach($gmediaLib as $item){
1199
  $content .= "<li class='gmedia-image-li' id='gm-img-{$item->ID}'>\n";
1200
- $content .= " <a target='_blank' class='gm-img' data-gmid='{$item->ID}' href='" . $gmCore->gm_get_media_image($item) . "'><img src='" . $gmCore->gm_get_media_image($item, 'thumb') . "' height='50' style='width:auto;' alt='' title='" . esc_attr($item->title) . "' /></a>\n";
1201
- $content .= " <div style='display: none;' class='gm-img-description'>" . esc_html($item->description) . "</div>\n";
1202
  $content .= "</li>\n";
1203
  }
1204
- if(($count < $per_page) && ($relative == 0 || !empty($s))){
1205
  $continue = false;
1206
  }
1207
- } else{
1208
- if($s){
1209
- $content .= '<li class="emptydb">' . __('No items matching the search query.', 'gmLang') . '</li>' . "\n";
1210
- } else{
1211
- $content .= '<li class="emptydb">' . __('No items to show', 'gmLang') . '</li>' . "\n";
1212
  }
1213
  $continue = false;
1214
  }
1215
- $result = array('paged' => $paged, 'rel' => $relative, 'continue' => $continue, 'content' => $content, 'data' => $post_tags);
1216
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
1217
- echo json_encode($result);
1218
 
1219
  die();
1220
 
1221
  }
1222
 
1223
- add_action('wp_ajax_gmedia_ftp_browser', 'gmedia_ftp_browser');
1224
  /**
1225
  * jQuery File Tree PHP Connector
1226
  * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
@@ -1228,34 +1360,34 @@ add_action('wp_ajax_gmedia_ftp_browser', 'gmedia_ftp_browser');
1228
  *
1229
  * @return string folder content
1230
  */
1231
- function gmedia_ftp_browser(){
1232
- if(!current_user_can('gmedia_import')){
1233
- die('No access');
1234
  }
1235
 
1236
  // if nonce is not correct it returns -1
1237
- check_ajax_referer('grandMedia');
1238
 
1239
  // start from the default path
1240
- $root = trailingslashit(ABSPATH);
1241
  // get the current directory
1242
- $dir = trailingslashit(urldecode($_POST['dir']));
1243
 
1244
- if(file_exists($root . $dir)){
1245
- $files = scandir($root . $dir);
1246
- natcasesort($files);
1247
 
1248
  // The 2 counts for . and ..
1249
- if(count($files) > 2){
1250
  echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
1251
  // return only directories
1252
- foreach($files as $file){
1253
- if(in_array($file, array('wp-admin', 'wp-includes', 'plugins', 'themes', 'thumb', 'thumbs'))){
1254
  continue;
1255
  }
1256
 
1257
- if(file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file)){
1258
- echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_attr($dir . $file) . "/\">" . esc_html($file) . "</a></li>";
1259
  }
1260
  }
1261
  echo "</ul>";
@@ -1264,3 +1396,93 @@ function gmedia_ftp_browser(){
1264
 
1265
  die();
1266
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ add_action( 'wp_ajax_gmedia_update_data', 'gmedia_update_data' );
3
+ function gmedia_update_data() {
4
  global $gmDB, $gmCore;
5
+ check_ajax_referer( "GmediaGallery" );
6
+ if ( ! current_user_can( 'gmedia_edit_media' ) ) {
7
+ die( '-1' );
8
  }
9
 
10
+ $data = $gmCore->_post( 'data' );
11
 
12
+ wp_parse_str( $data, $gmedia );
13
 
14
+ if ( ! empty( $gmedia['ID'] ) ) {
15
+ $item = $gmDB->get_gmedia( $gmedia['ID'] );
16
+ if ( (int) $item->author != get_current_user_id() ) {
17
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
18
+ die( '-2' );
19
  }
20
  }
21
 
22
+ $gmedia['modified'] = current_time( 'mysql' );
23
  $gmedia['mime_type'] = $item->mime_type;
24
+ $gmedia['gmuid'] = $item->gmuid;
25
+ if ( ! current_user_can( 'gmedia_delete_others_media' ) ) {
26
+ $gmedia['author'] = $item->author;
27
+ }
28
 
29
+ $gmuid = pathinfo( $item->gmuid );
30
 
31
+ $gmedia['filename'] = preg_replace( '/[^a-z0-9_\.-]+/i', '_', $gmedia['filename'] );
32
+ if ( ( $gmedia['filename'] != $gmuid['filename'] ) && ( (int) $item->author == get_current_user_id() ) ) {
33
+ $fileinfo = $gmCore->fileinfo( $gmedia['filename'] . '.' . $gmuid['extension'] );
34
+ if ( false !== $fileinfo ) {
35
+ if ( 'image' == $fileinfo['dirname'] && file_is_displayable_image( $fileinfo['dirpath'] . '/' . $item->gmuid ) ) {
36
+ @rename( $fileinfo['dirpath_original'] . '/' . $item->gmuid, $fileinfo['filepath_original'] );
37
+ @rename( $fileinfo['dirpath_thumb'] . '/' . $item->gmuid, $fileinfo['filepath_thumb'] );
38
+ }
39
+ if ( @rename( $fileinfo['dirpath'] . '/' . $item->gmuid, $fileinfo['filepath'] ) ) {
40
+ $gmedia['gmuid'] = $fileinfo['basename'];
41
+ }
42
  }
43
  }
44
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
45
+ unset( $gmedia['terms'] );
46
  }
47
 
48
+ $id = $gmDB->insert_gmedia( $gmedia );
49
+ if ( ! is_wp_error( $id ) ) {
50
  // Meta Stuff
51
+ if ( isset( $gmedia['meta'] ) && is_array( $gmedia['meta'] ) ) {
52
+ foreach ( $gmedia['meta'] as $key => $value ) {
53
+ if ( 'cover' == $key ) {
54
+ $value = ltrim( $value, '#' );
55
  }
56
+ $gmDB->update_metadata( 'gmedia', $id, $key, $value );
57
  }
58
  }
59
+ $result = $gmDB->get_gmedia( $id );
60
+ } else {
61
+ $result = $gmDB->get_gmedia( $id );
62
  }
63
+ if ( current_user_can( 'gmedia_terms' ) ) {
64
+ $tags = $gmDB->get_the_gmedia_terms( $id, 'gmedia_tag' );
65
+ if ( $tags ) {
66
  $tags_list = array();
67
+ foreach ( $tags as $tag ) {
68
  $tags_list[] = $tag->name;
69
  }
70
+ $result->tags = implode( ', ', $tags_list );
71
+ }
72
+ if ( ! empty( $gmedia['terms']['gmedia_album'] ) ) {
73
+ $alb_id = (int) $gmedia['terms']['gmedia_album'];
74
+ $alb = $gmDB->get_term( $alb_id, 'gmedia_album' );
75
+ $result->album_status = $alb->status;
76
+ } else {
77
+ $result->album_status = 'none';
78
  }
 
 
 
 
 
 
 
79
  }
80
 
81
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
82
+ echo json_encode( $result );
83
  }
84
 
85
  die();
86
  }
87
 
88
+ add_action( 'wp_ajax_gmedit_save', 'gmedit_save' );
89
+ function gmedit_save() {
90
  global $gmDB, $gmCore, $gmGallery, $gmProcessor;
91
+ check_ajax_referer( "gmedit-save" );
92
+ if ( ! current_user_can( 'gmedia_edit_media' ) ) {
93
+ die( '-1' );
94
  }
95
 
96
+ $gmedia = array();
97
+ $fail = '';
98
  $success = '';
99
+ $gmid = $gmCore->_post( 'id' );
100
+ $image = $gmCore->_post( 'image' );
101
+ $applyto = $gmCore->_post( 'applyto', 'web' );
102
+
103
+ $item = $gmDB->get_gmedia( $gmid );
104
+ if ( ! empty( $item ) ) {
105
+ if ( (int) $item->author != get_current_user_id() ) {
106
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
107
+ die( '-2' );
108
  }
109
  }
110
+ $meta = $gmDB->get_metadata( 'gmedia', $item->ID, '_metadata', true );
111
+ $gmedia['ID'] = $gmid;
112
+ $gmedia['date'] = $item->date;
113
+ $gmedia['modified'] = current_time( 'mysql' );
114
+ $gmedia['author'] = $item->author;
115
 
116
+ $webimg = $gmGallery->options['image'];
117
  $thumbimg = $gmGallery->options['thumb'];
118
 
119
+ $image = $gmCore->process_gmedit_image( $image );
120
 
121
+ $fileinfo = $gmCore->fileinfo( $item->gmuid, false );
122
 
123
+ if ( ! file_exists( $fileinfo['filepath_original'] . '_backup' ) ) {
124
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath_original'] . '_backup' );
125
  }
126
+ rename( $fileinfo['filepath_original'], $fileinfo['filepath_original'] . '.tmp' );
127
+ file_put_contents( $fileinfo['filepath_original'], $image['data'] );
128
+ $size = @getimagesize( $fileinfo['filepath_original'] );
129
+
130
+ do {
131
+ if ( function_exists( 'memory_get_usage' ) ) {
132
+ $extensions = array( '1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP' );
133
+ switch ( $extensions[ $size[2] ] ) {
134
+ case 'GIF':
135
+ $CHANNEL = 1;
136
+ break;
137
+ case 'JPG':
138
+ $CHANNEL = $size['channels'];
139
+ break;
140
+ case 'PNG':
141
+ $CHANNEL = 3;
142
+ break;
143
+ case 'BMP':
144
+ default:
145
+ $CHANNEL = 6;
146
+ break;
147
+ }
148
+ $MB = 1048576; // number of bytes in 1M
149
+ $K64 = 65536; // number of bytes in 64K
150
+ $TWEAKFACTOR = 1.8; // Or whatever works for you
151
+ $memoryNeeded = round( ( $size[0] * $size[1] * $size['bits'] * $CHANNEL / 8 + $K64 ) * $TWEAKFACTOR );
152
+ $memoryNeeded = memory_get_usage() + $memoryNeeded;
153
+ $current_limit = @ini_get( 'memory_limit' );
154
+ $current_limit_int = intval( $current_limit );
155
+ if ( false !== strpos( $current_limit, 'M' ) ) {
156
+ $current_limit_int *= $MB;
157
+ }
158
+ if ( false !== strpos( $current_limit, 'G' ) ) {
159
+ $current_limit_int *= 1024;
160
+ }
161
+
162
+ if ( - 1 != $current_limit && $memoryNeeded > $current_limit_int ) {
163
+ $newLimit = $current_limit_int / $MB + ceil( ( $memoryNeeded - $current_limit_int ) / $MB );
164
+ @ini_set( 'memory_limit', $newLimit . 'M' );
165
+ }
166
+ }
167
+
168
+ $editor = wp_get_image_editor( $fileinfo['filepath_original'] );
169
+ if ( is_wp_error( $editor ) ) {
170
+ @unlink( $fileinfo['filepath_original'] );
171
+ rename( $fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original'] );
172
  $fail = $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message();
173
  break;
174
  }
175
 
176
+ $webis = false;
177
  $thumbis = false;
178
  // Web-image
179
+ if ( 'web' == $applyto || 'original' == $applyto ) {
180
+ $webimg['resize'] = ( ( $webimg['width'] < $size[0] ) || ( $webimg['height'] < $size[1] ) ) ? true : false;
181
+ if ( $webimg['resize'] ) {
182
+ $editor->set_quality( $webimg['quality'] );
183
+ $resized = $editor->resize( $webimg['width'], $webimg['height'], $webimg['crop'] );
184
+ if ( is_wp_error( $resized ) ) {
185
+ @unlink( $fileinfo['filepath_original'] );
186
+ rename( $fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original'] );
187
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message();
188
  break;
189
  }
190
+ if ( file_exists( $fileinfo['filepath'] ) ) {
191
  $webis = true;
192
+ rename( $fileinfo['filepath'], $fileinfo['filepath'] . '.tmp' );
193
  }
194
+ $saved = $editor->save( $fileinfo['filepath'] );
195
+ if ( is_wp_error( $saved ) ) {
196
+ @unlink( $fileinfo['filepath_original'] );
197
+ rename( $fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original'] );
198
+ if ( $webis ) {
199
+ rename( $fileinfo['filepath'] . '.tmp', $fileinfo['filepath'] );
200
  }
201
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message();
202
  break;
203
  }
204
+ } else {
205
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath'] );
206
  }
207
  }
208
 
209
  // Thumbnail
210
+ $thumbimg['resize'] = ( ( $thumbimg['width'] < $size[0] ) || ( $thumbimg['height'] < $size[1] ) ) ? true : false;
211
+ if ( $thumbimg['resize'] ) {
212
+ $editor->set_quality( $thumbimg['quality'] );
213
+ $resized = $editor->resize( $thumbimg['width'], $thumbimg['height'], $thumbimg['crop'] );
214
+ if ( is_wp_error( $resized ) ) {
215
+ @unlink( $fileinfo['filepath_original'] );
216
+ rename( $fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original'] );
217
+ if ( $webis ) {
218
+ @unlink( $fileinfo['filepath'] );
219
+ rename( $fileinfo['filepath'] . '.tmp', $fileinfo['filepath'] );
220
  }
221
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})): " . $resized->get_error_message();
222
  break;
223
  }
224
 
225
+ if ( file_exists( $fileinfo['filepath_thumb'] ) ) {
226
  $thumbis = true;
227
+ rename( $fileinfo['filepath_thumb'], $fileinfo['filepath_thumb'] . '.tmp' );
228
  }
229
+ $saved = $editor->save( $fileinfo['filepath_thumb'] );
230
+ if ( is_wp_error( $saved ) ) {
231
+ @unlink( $fileinfo['filepath_original'] );
232
+ rename( $fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original'] );
233
+ if ( $webis ) {
234
+ @unlink( $fileinfo['filepath'] );
235
+ rename( $fileinfo['filepath'] . '.tmp', $fileinfo['filepath'] );
236
  }
237
+ if ( $thumbis ) {
238
+ rename( $fileinfo['filepath_thumb'] . '.tmp', $fileinfo['filepath_thumb'] );
239
  }
240
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->thumb): " . $saved->get_error_message();
241
  break;
242
  }
243
 
244
+ } else {
245
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath'] );
246
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath_thumb'] );
247
  }
248
 
249
+ if ( 'original' !== $applyto ) {
250
+ @unlink( $fileinfo['filepath_original'] );
251
+ rename( $fileinfo['filepath_original'] . '.tmp', $fileinfo['filepath_original'] );
252
+ if ( filesize( $fileinfo['filepath_original'] ) === filesize( $fileinfo['filepath_original'] . '_backup' ) ) {
253
+ @unlink( $fileinfo['filepath_original'] . '_backup' );
254
  }
255
  }
256
+ if ( file_exists( $fileinfo['filepath'] . '.tmp' ) ) {
257
+ @unlink( $fileinfo['filepath'] . '.tmp' );
258
  }
259
+ if ( file_exists( $fileinfo['filepath_original'] . '.tmp' ) ) {
260
+ @unlink( $fileinfo['filepath_original'] . '.tmp' );
261
  }
262
+ if ( file_exists( $fileinfo['filepath_thumb'] . '.tmp' ) ) {
263
+ @unlink( $fileinfo['filepath_thumb'] . '.tmp' );
264
  }
265
 
266
+ $id = $gmDB->insert_gmedia( $gmedia );
267
 
268
+ $metadata = $gmDB->generate_gmedia_metadata( $id, $fileinfo );
269
+ $meta['web'] = $metadata['web'];
270
  $meta['original'] = $metadata['original'];
271
+ $meta['thumb'] = $metadata['thumb'];
272
 
273
+ $gmDB->update_metadata( $meta_type = 'gmedia', $id, $meta_key = '_metadata', $meta );
274
 
275
+ $success = sprintf( __( 'Image "%d" updated', 'gmLang' ), $id );
276
+ } while ( 0 );
277
 
278
+ if ( empty( $fail ) ) {
279
+ $out = array( 'msg' => $gmProcessor->alert( 'info', $success ), 'modified' => $gmedia['modified'] );
280
+ } else {
281
+ $out = array( 'error' => $gmProcessor->alert( 'danger', $fail ) );
282
  }
283
 
284
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
285
+ echo json_encode( $out );
286
  }
287
 
288
  die();
289
  }
290
 
291
+ add_action( 'wp_ajax_gmedit_restore', 'gmedit_restore' );
292
+ function gmedit_restore() {
293
  global $gmDB, $gmCore, $gmGallery, $gmProcessor;
294
+ check_ajax_referer( "gmedit-save" );
295
+ if ( ! current_user_can( 'gmedia_edit_media' ) ) {
296
+ die( '-1' );
297
  }
298
 
299
+ $gmedia = array();
300
+ $fail = '';
301
  $success = '';
302
+ $gmid = $gmCore->_post( 'id' );
303
 
304
+ $item = $gmDB->get_gmedia( $gmid );
305
+ if ( ! empty( $item ) ) {
306
+ if ( (int) $item->author != get_current_user_id() ) {
307
+ if ( ! current_user_can( 'gmedia_edit_others_media' ) ) {
308
+ die( '-2' );
309
  }
310
  }
311
+ $meta = $gmDB->get_metadata( 'gmedia', $item->ID, '_metadata', true );
312
+ $gmedia['ID'] = $gmid;
313
+ $gmedia['date'] = $item->date;
314
+ $gmedia['modified'] = current_time( 'mysql' );
315
+ $gmedia['author'] = $item->author;
316
 
317
+ $webimg = $gmGallery->options['image'];
318
  $thumbimg = $gmGallery->options['thumb'];
319
 
320
+ $fileinfo = $gmCore->fileinfo( $item->gmuid, false );
321
 
322
+ if ( file_exists( $fileinfo['filepath_original'] . '_backup' ) ) {
323
+ rename( $fileinfo['filepath_original'] . '_backup', $fileinfo['filepath_original'] );
324
  }
325
+ $size = @getimagesize( $fileinfo['filepath_original'] );
326
+
327
+ do {
328
+ if ( function_exists( 'memory_get_usage' ) ) {
329
+ $extensions = array( '1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP' );
330
+ switch ( $extensions[ $size[2] ] ) {
331
+ case 'GIF':
332
+ $CHANNEL = 1;
333
+ break;
334
+ case 'JPG':
335
+ $CHANNEL = $size['channels'];
336
+ break;
337
+ case 'PNG':
338
+ $CHANNEL = 3;
339
+ break;
340
+ case 'BMP':
341
+ default:
342
+ $CHANNEL = 6;
343
+ break;
344
+ }
345
+ $MB = 1048576; // number of bytes in 1M
346
+ $K64 = 65536; // number of bytes in 64K
347
+ $TWEAKFACTOR = 1.8; // Or whatever works for you
348
+ $memoryNeeded = round( ( $size[0] * $size[1] * $size['bits'] * $CHANNEL / 8 + $K64 ) * $TWEAKFACTOR );
349
+ $memoryNeeded = memory_get_usage() + $memoryNeeded;
350
+ $current_limit = @ini_get( 'memory_limit' );
351
+ $current_limit_int = intval( $current_limit );
352
+ if ( false !== strpos( $current_limit, 'M' ) ) {
353
+ $current_limit_int *= $MB;
354
+ }
355
+ if ( false !== strpos( $current_limit, 'G' ) ) {
356
+ $current_limit_int *= 1024;
357
+ }
358
+
359
+ if ( - 1 != $current_limit && $memoryNeeded > $current_limit_int ) {
360
+ $newLimit = $current_limit_int / $MB + ceil( ( $memoryNeeded - $current_limit_int ) / $MB );
361
+ @ini_set( 'memory_limit', $newLimit . 'M' );
362
+ }
363
+ }
364
 
365
+ $editor = wp_get_image_editor( $fileinfo['filepath_original'] );
366
+ if ( is_wp_error( $editor ) ) {
 
367
  $fail = $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message();
368
  break;
369
  }
370
 
371
+ $thumbimg['resize'] = ( ( $thumbimg['width'] < $size[0] ) || ( $thumbimg['height'] < $size[1] ) ) ? true : false;
372
+ if ( $thumbimg['resize'] ) {
373
 
374
+ $webimg['resize'] = ( ( $webimg['width'] < $size[0] ) || ( $webimg['height'] < $size[1] ) ) ? true : false;
375
+ if ( $webimg['resize'] ) {
376
  // Web-image
377
+ $editor->set_quality( $webimg['quality'] );
378
+ $resized = $editor->resize( $webimg['width'], $webimg['height'], $webimg['crop'] );
379
+ if ( is_wp_error( $resized ) ) {
380
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message();
381
  break;
382
  }
383
 
384
+ $saved = $editor->save( $fileinfo['filepath'] );
385
+ if ( is_wp_error( $saved ) ) {
386
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message();
387
  break;
388
  }
389
+ } else {
390
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath'] );
391
  }
392
 
393
  // Thumbnail
394
+ $editor->set_quality( $thumbimg['quality'] );
395
+ $resized = $editor->resize( $thumbimg['width'], $thumbimg['height'], $thumbimg['crop'] );
396
+ if ( is_wp_error( $resized ) ) {
397
  $fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})): " . $resized->get_error_message();
398
  break;
399
  }
400
 
401
+ $saved = $editor->save( $fileinfo['filepath_thumb'] );
402
+ if ( is_wp_error( $saved ) ) {
403
  $fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->thumb): " . $saved->get_error_message();
404
  break;
405
  }
406
 
407
+ } else {
408
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath'] );
409
+ @copy( $fileinfo['filepath_original'], $fileinfo['filepath_thumb'] );
410
  }
411
 
412
+ $id = $gmDB->insert_gmedia( $gmedia );
413
 
414
+ $metadata = $gmDB->generate_gmedia_metadata( $id, $fileinfo );
415
+ $meta['web'] = $metadata['web'];
416
  $meta['original'] = $metadata['original'];
417
+ $meta['thumb'] = $metadata['thumb'];
418
 
419
+ $gmDB->update_metadata( $meta_type = 'gmedia', $id, $meta_key = '_metadata', $meta );
420
 
421
+ $success = sprintf( __( 'Image "%d" restored from backup and saved', 'gmLang' ), $id );
422
+ } while ( 0 );
423
 
424
+ if ( empty( $fail ) ) {
425
+ $out = array( 'msg' => $gmProcessor->alert( 'info', $success ), 'modified' => $gmedia['modified'] );
426
+ } else {
427
+ $out = array( 'error' => $gmProcessor->alert( 'danger', $fail ) );
428
  }
429
 
430
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
431
+ echo json_encode( $out );
432
  }
433
 
434
  die();
435
  }
436
 
437
+ add_action( 'wp_ajax_gmedia_get_modal', 'gmedia_get_modal' );
438
+ function gmedia_get_modal() {
439
  global $gmDB, $gmCore, $gmGallery;
440
+ check_ajax_referer( "GmediaGallery" );
441
+ $user_ID = get_current_user_id();
442
  $button_class = 'btn-primary';
443
+ $gm_terms = array();
444
+ $modal = $gmCore->_post( 'modal' );
445
+ switch ( $modal ) {
446
  case 'quick_gallery':
447
+ if ( ! current_user_can( 'gmedia_gallery_manage' ) ) {
448
+ die( '-1' );
449
  }
450
+ $modal_title = __( 'Quick Gallery from selected items', 'gmLang' );
451
+ $modal_button = __( 'Create Quick Gallery', 'gmLang' );
452
  break;
453
  case 'filter_categories':
454
+ $modal_title = __( 'Show Images from Categories', 'gmLang' );
455
+ $modal_button = __( 'Show Selected', 'gmLang' );
456
  break;
457
  case 'assign_category':
458
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
459
+ die( '-1' );
460
  }
461
+ $modal_title = __( 'Assign Category for Selected Images', 'gmLang' );
462
+ $modal_button = __( 'Assign Category', 'gmLang' );
463
  break;
464
  case 'filter_albums':
465
+ $modal_title = __( 'Filter Albums', 'gmLang' );
466
+ $modal_button = __( 'Show Selected', 'gmLang' );
467
  break;
468
  case 'assign_album':
469
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
470
+ die( '-1' );
471
  }
472
+ $modal_title = __( 'Assign Album for Selected Items', 'gmLang' );
473
+ $modal_button = __( 'Assign Album', 'gmLang' );
474
  break;
475
  case 'filter_tags':
476
+ $modal_title = __( 'Filter by Tags', 'gmLang' );
477
+ $modal_button = __( 'Show Selected', 'gmLang' );
478
  break;
479
  case 'add_tags':
480
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
481
+ die( '-1' );
482
  }
483
+ $modal_title = __( 'Add Tags to Selected Items', 'gmLang' );
484
+ $modal_button = __( 'Add Tags', 'gmLang' );
485
  break;
486
  case 'delete_tags':
487
+ if ( ! current_user_can( 'gmedia_terms' ) ) {
488
+ die( '-1' );
489
  }
490
  $button_class = 'btn-danger';
491
+ $modal_title = __( 'Delete Tags from Selected Items', 'gmLang' );
492
+ $modal_button = __( 'Delete Tags', 'gmLang' );
493
  break;
494
  case 'filter_authors':
495
+ $modal_title = __( 'Filter by Author', 'gmLang' );
496
+ if ( $gmCore->caps['gmedia_show_others_media'] ) {
497
+ $modal_button = __( 'Show Selected', 'gmLang' );
498
+ } else {
499
  $modal_button = false;
500
  }
501
  break;
502
  case 'batch_edit':
503
+ if ( ! current_user_can( 'gmedia_edit_media' ) ) {
504
+ die( '-1' );
505
  }
506
+ $modal_title = __( 'Batch Edit', 'gmLang' );
507
+ $modal_button = __( 'Batch Save', 'gmLang' );
508
  break;
509
  default:
510
+ $modal_title = ' ';
511
  $modal_button = false;
512
  break;
513
  }
519
  </div>
520
  <div class="modal-body">
521
  <?php
522
+ switch ( $modal ) {
523
+ case 'quick_gallery':
524
+ global $user_ID;
525
+ $ckey = "gmuser_{$user_ID}_library";
526
+ $selected = isset( $_COOKIE[ $ckey ] ) ? $_COOKIE[ $ckey ] : '';
527
+ if ( empty( $selected ) ) {
528
+ _e( 'No selected Gmedia. Select at least one item in library.', 'gmLang' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  }
531
+ $modules = array();
532
+ if ( ( $plugin_modules = glob( GMEDIA_ABSPATH . 'module/*', GLOB_ONLYDIR | GLOB_NOSORT ) ) ) {
533
+ foreach ( $plugin_modules as $path ) {
534
+ $mfold = basename( $path );
535
+ $modules[ $mfold ] = array(
536
+ 'place' => 'plugin',
537
+ 'module_name' => $mfold,
538
+ 'module_url' => "{$gmCore->gmedia_url}/module/{$mfold}",
539
+ 'module_path' => $path
540
+ );
541
  }
542
  }
543
+ if ( ( $upload_modules = glob( $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/*', GLOB_ONLYDIR | GLOB_NOSORT ) ) ) {
544
+ foreach ( $upload_modules as $path ) {
545
+ $mfold = basename( $path );
546
+ $modules[ $mfold ] = array(
547
+ 'place' => 'upload',
548
+ 'module_name' => $mfold,
549
+ 'module_url' => "{$gmCore->upload['url']}/{$gmGallery->options['folder']['module']}/{$mfold}",
550
+ 'module_path' => $path
551
  );
552
  }
553
+ }
554
+ ?>
555
+ <div class="form-group">
556
+ <label><?php _e( 'Gallery Name', 'gmLang' ); ?></label>
557
+ <input type="text" class="form-control input-sm" name="gallery[name]" placeholder="<?php echo esc_attr( __( 'Gallery Name', 'gmLang' ) ); ?>" value="" required="required"/>
558
+ </div>
559
+ <div class="form-group">
560
+ <label><?php _e( 'Modue', 'gmLang' ); ?></label>
561
+ <select class="form-control input-sm" name="gallery[module]">
562
+ <?php
563
+ if ( ! empty( $modules ) ) {
564
+ foreach ( $modules as $m ) {
565
+ /**
566
+ * @var $module_name
567
+ * @var $module_url
568
+ * @var $module_path
569
+ */
570
+ extract( $m );
571
+ if ( ! file_exists( $module_path . '/index.php' ) ) {
572
+ continue;
573
+ }
574
+ $module_info = array();
575
+ include( $module_path . '/index.php' );
576
+ if ( empty( $module_info ) ) {
577
+ continue;
578
+ }
579
+ ?>
580
+ <option value="<?php echo $module_name; ?>"><?php echo $module_info['title']; ?></option>
581
+ <?php
582
  }
 
 
 
 
 
 
 
 
583
  }
584
  ?>
585
+ </select>
586
+ </div>
587
+ <div class="form-group">
588
+ <label><?php _e( 'Selected IDs', 'gmLang' ); ?></label>
589
+ <input type="text" name="gallery[query][gmedia__in][]" class="form-control input-sm" value="<?php echo $selected; ?>" required="required"/>
590
+ </div>
591
+ <?php
592
+ break;
593
+ case 'filter_categories':
594
+ $gm_terms = $gmDB->get_terms( 'gmedia_category' );
595
+ ?>
596
+ <div class="checkbox"><label><input type="checkbox" name="cat[]" value="0"> <?php _e( 'Uncategorized', 'gmLang' ); ?></label></div>
597
+ <?php if ( count( $gm_terms ) ) {
598
+ foreach ( $gm_terms as $term ) {
599
+ if ( $term->count ) {
600
+ ?>
601
+ <div class="checkbox">
602
+ <label><input type="checkbox" name="cat[]" value="<?php echo $term->term_id; ?>"> <?php echo esc_html( $term->name ); ?></label>
603
+ <span class="badge pull-right"><?php echo $term->count; ?></span>
604
+ </div>
605
+ <?php
606
+ }
607
+ }
608
+ }
609
+ break;
610
+ case 'assign_category':
611
+ $term_type = 'gmedia_category';
612
+ $gm_terms = $gmGallery->options['taxonomies'][ $term_type ];
613
+ ?>
614
+ <div class="radio"><label><input type="radio" name="cat" value="0"> <?php _e( 'Uncategorized', 'gmLang' ); ?></label></div>
615
+ <?php if ( count( $gm_terms ) ) {
616
+ foreach ( $gm_terms as $term_name => $term_title ) {
617
+ echo '<div class="radio"><label><input type="radio" name="cat" value="' . $term_name . '"> ' . esc_html( $term_title ) . '</label></div>';
618
+ }
619
+ }
620
+ break;
621
+ case 'filter_albums':
622
+ if ( $gmCore->caps['gmedia_show_others_media'] ) {
623
+ $args = array();
624
+ } else {
625
+ $args = array(
626
+ 'global' => array( 0, $user_ID ),
627
+ 'orderby' => 'global_desc_name'
628
+ );
629
+ }
630
+ $gm_terms = $gmDB->get_terms( 'gmedia_album', $args );
631
+ ?>
632
+ <div class="checkbox"><label><input type="checkbox" name="alb[]" value="0"> <?php _e( 'No Album', 'gmLang' ); ?></label></div>
633
+ <hr/>
634
+ <?php if ( count( $gm_terms ) ) {
635
+ foreach ( $gm_terms as $term ) {
636
+ $author_name = '';
637
+ if ( $term->global ) {
638
+ if ( $gmCore->caps['gmedia_show_others_media'] ) {
639
+ $author_name .= sprintf( __( 'by %s', 'gmLang' ), get_the_author_meta( 'display_name', $term->global ) );
640
  }
641
+ } else {
642
+ $author_name .= '(' . __( 'shared', 'gmLang' ) . ')';
643
  }
644
+ if ( 'public' != $term->status ) {
645
+ $author_name .= ' [' . $term->status . ']';
646
+ }
647
+ if ( $author_name ) {
648
+ $author_name = " <small>{$author_name}</small>";
649
+ }
650
+ ?>
651
+ <div class="checkbox">
652
+ <label><input type="checkbox" name="alb[]" value="<?php echo $term->term_id; ?>"> <?php echo esc_html( $term->name ) . $author_name; ?></label>
653
+ <span class="badge pull-right"><?php echo $term->count; ?></span>
654
+ </div>
655
+ <?php
656
+ }
657
+ } else {
658
+ $modal_button = false;
659
+ }
660
+ break;
661
+ case 'assign_album':
662
+ if ( $gmCore->caps['gmedia_edit_others_media'] ) {
663
+ $args = array();
664
+ } else {
665
+ $args = array(
666
+ 'global' => array( 0, $user_ID ),
667
+ 'orderby' => 'global_desc_name'
668
+ );
669
+ }
670
+ $gm_terms = $gmDB->get_terms( 'gmedia_album', $args );
671
+
672
+ $terms_album = '';
673
+ if ( count( $gm_terms ) ) {
674
+ foreach ( $gm_terms as $term ) {
675
+ $author_name = '';
676
+ if ( $term->global ) {
677
+ if ( $gmCore->caps['gmedia_edit_others_media'] ) {
678
+ $author_name .= ' &nbsp; ' . sprintf( __( 'by %s', 'gmLang' ), get_the_author_meta( 'display_name', $term->global ) );
679
+ }
680
+ } else {
681
+ $author_name .= ' &nbsp; (' . __( 'shared', 'gmLang' ) . ')';
682
  }
683
+ if ( 'public' != $term->status ) {
684
+ $author_name .= ' [' . $term->status . ']';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  }
686
+ $terms_album .= '<option value="' . $term->term_id . '" data-count="' . $term->count . '" data-name="' . esc_html( $term->name ) . '" data-meta="' . $author_name . '">' . esc_html( $term->name ) . $author_name . '</option>' . "\n";
687
+ }
688
+ }
689
+ ?>
690
+ <div class="form-group">
691
+ <label><?php _e( 'Move to Album', 'gmLang' ); ?> </label>
692
+ <select id="combobox_gmedia_album" name="alb" class="form-control" placeholder="<?php _e( 'Album Name...', 'gmLang' ); ?>">
693
+ <option></option>
694
+ <option value="0"><?php _e( 'No Album', 'gmLang' ); ?></option>
695
+ <?php echo $terms_album; ?>
696
+ </select>
697
+ </div>
698
+ <div class="form-group">
699
+ <div class="checkbox"><label><input type="checkbox" name="status_global" value="1" checked> <?php _e( 'Make status of selected items be the same as Album status', 'gmLang' ); ?></label></div>
700
+ </div>
701
+ <script type="text/javascript">
702
+ jQuery(function ($) {
703
+ var albums = $('#combobox_gmedia_album');
704
+ var albums_data = $('option', albums);
705
+ albums.selectize({
706
+ <?php if($gmCore->caps['gmedia_album_manage']){ ?>
707
+ create: function (input) {
708
+ return {
709
+ value: input,
710
+ text: input
711
+ }
712
+ },
713
+ createOnBlur: true,
714
+ <?php } else{ ?>
715
+ create: false,
716
+ <?php } ?>
717
+ persist: false,
718
+ render: {
719
+ item: function (item, escape) {
720
+ if (0 === (parseInt(item.value, 10) || 0)) {
721
+ return '<div>' + escape(item.text) + '</div>';
 
 
 
 
 
722
  }
723
+ if (item.$order) {
724
+ var data = $(albums_data[item.$order]).data();
725
+ return '<div>' + escape(data.name) + ' <small>' + escape(data.meta) + '</small></div>';
726
+ }
727
+ },
728
+ option: function (item, escape) {
729
+ if (0 === (parseInt(item.value) || 0)) {
730
+ return '<div>' + escape(item.text) + '</div>';
731
+ }
732
+ if (item.$order) {
733
+ var data = $(albums_data[item.$order]).data();
734
+ return '<div>' + escape(data.name) + ' <small>' + escape(data.meta) + '</small>' + ' <span class="badge pull-right">' + escape(data.count) + '</span></div>';
735
+ }
736
+ }
737
+ }
738
+
739
+ });
740
+ });
741
+ </script>
742
+ <?php
743
+ break;
744
+ case 'filter_tags':
745
+ $gm_terms = $gmDB->get_terms( 'gmedia_tag', array( 'fields' => 'names_count' ) );
746
+ $gm_terms = array_values( $gm_terms );
747
+ if (count( $gm_terms )){
748
+ ?>
749
+ <div class="form-group">
750
+ <input id="combobox_gmedia_tag" name="tag_ids" class="form-control input-sm" value="" placeholder="<?php _e( 'Filter Tags...', 'gmLang' ); ?>"/></div>
751
+ <script type="text/javascript">
752
+ jQuery(function ($) {
753
+ var gm_terms = <?php echo json_encode($gm_terms); ?>;
754
+ var items = gm_terms.map(function (x) {
755
+ return {id: x.term_id, name: x.name, count: x.count};
756
+ });
757
+ $('#combobox_gmedia_tag').selectize({
758
+ delimiter: ',',
759
+ maxItems: null,
760
+ openOnFocus: true,
761
+ labelField: 'name',
762
+ hideSelected: true,
763
+ options: items,
764
+ searchField: ['name'],
765
+ valueField: 'id',
766
+ create: false,
767
+ render: {
768
+ item: function (item, escape) {
769
+ return '<div>' + escape(item.name) + '</div>';
770
+ },
771
+ option: function (item, escape) {
772
+ return '<div>' + escape(item.name) + ' <span class="badge">' + escape(item.count) + '</span></div>';
773
+ }
774
+ }
775
+ });
776
+ });
777
+ </script>
778
+ <?php
779
+ } else {
780
+ $modal_button = false; ?>
781
+ <p class="notags"><?php _e( 'No tags', 'gmLang' ); ?></p>
782
+ <?php
783
+ }
784
+ break;
785
+ case 'add_tags':
786
+ $gm_terms = $gmDB->get_terms( 'gmedia_tag', array( 'fields' => 'names_count' ) );
787
+ $gm_terms = array_values( $gm_terms );
788
+ if (count( $gm_terms )){
789
+ ?>
790
+ <div class="form-group">
791
+ <input id="combobox_gmedia_tag" name="tag_names" class="form-control input-sm" value="" placeholder="<?php _e( 'Add Tags...', 'gmLang' ); ?>"/></div>
792
+ <script type="text/javascript">
793
+ jQuery(function ($) {
794
+ var gm_terms = <?php echo json_encode($gm_terms); ?>;
795
+ var items = gm_terms.map(function (x) {
796
+ return {id: x.term_id, name: x.name, count: x.count};
797
+ });
798
+ $('#combobox_gmedia_tag').selectize({
799
+ delimiter: ',',
800
+ maxItems: null,
801
+ openOnFocus: false,
802
+ labelField: 'name',
803
+ hideSelected: true,
804
+ options: items,
805
+ searchField: ['name'],
806
+ valueField: 'name',
807
+ persist: false,
808
+ <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
809
+ createOnBlur: true,
810
+ create: function (input) {
811
+ return {
812
+ name: input
813
+ }
814
+ },
815
+ <?php } else{ ?>
816
+ create: false,
817
+ <?php } ?>
818
+ render: {
819
+ item: function (item, escape) {
820
+ return '<div>' + escape(item.name) + '</div>';
821
+ },
822
+ option: function (item, escape) {
823
+ return '<div>' + escape(item.name) + ' <span class="badge">' + escape(item.count) + '</span></div>';
824
+ }
825
  }
826
+ });
827
+ });
828
+ </script>
829
+ <?php
830
+ } else {
831
+ $modal_button = false; ?>
832
+ <p class="notags"><?php _e( 'No tags', 'gmLang' ); ?></p>
833
+ <?php
834
+ }
835
+ break;
836
+ case 'delete_tags':
837
+ global $gmProcessor;
838
+ if ( ! empty( $gmProcessor->selected_items ) ) {
839
+ $gm_terms = $gmDB->get_gmedia_terms( $gmProcessor->selected_items, 'gmedia_tag' );
840
+ }
841
+ if (count( $gm_terms )){
842
+ foreach ($gm_terms as $term){
843
+ ?>
844
+ <div class="checkbox">
845
+ <label><input type="checkbox" name="tag_id[]" value="<?php echo $term->term_id; ?>"> <?php echo esc_html( $term->name ); ?></label>
846
+ <span class="badge pull-right"><?php echo $term->count; ?></span>
847
+ </div>
848
+ <?php
849
+ }
850
+ } else {
851
+ $modal_button = false; ?>
852
+ <p class="notags"><?php _e( 'No tags', 'gmLang' ); ?></p>
853
+ <?php
854
+ }
855
+ break;
856
+ case 'filter_authors':
857
+ if ($gmCore->caps['gmedia_show_others_media']){
858
+ ?>
859
+ <div class="form-group">
860
+ <label><?php _e( 'Choose Author', 'gmLang' ); ?></label>
861
  <?php
862
+ $user_ids = $gmCore->get_editable_user_ids();
863
+ if ( $user_ids ) {
864
+ if ( ! in_array( $user_ID, $user_ids ) ) {
865
+ array_push( $user_ids, $user_ID );
866
+ }
867
+ wp_dropdown_users( array(
868
+ 'show_option_all' => ' &#8212; ',
869
+ 'include' => $user_ids,
870
+ 'include_selected' => true,
871
+ 'name' => 'author_ids',
872
+ 'selected' => $user_ID,
873
+ 'class' => 'form-control'
874
+ ) );
875
+ } else {
876
+ echo '<div>' . get_the_author_meta( 'display_name', $user_ID ) . '</div>';
877
  }
 
 
878
  ?>
879
+ </div>
880
+ <?php
881
+ } else {
882
+ echo '<p>' . __( 'You are not allowed to see others media' ) . '</p>';
883
+ echo '<p><strong>' . get_the_author_meta( 'display_name', $user_ID ) . '</strong></p>';
884
+ }
885
+ break;
886
+ case 'batch_edit':
887
+ ?>
888
+ <p><?php _e( 'Note, data will be saved to all selected items in Gmedia Library.' ) ?></p>
889
+ <div class="form-group">
890
+ <label><?php _e( 'Title', 'gmLang' ); ?></label>
891
+ <select class="form-control input-sm batch_set" name="batch_title">
892
+ <option value=""><?php _e( 'Skip. Do not change', 'gmLang' ); ?></option>
893
+ <option value="empty"><?php _e( 'Empty Title', 'gmLang' ); ?></option>
894
+ <option value="filename"><?php _e( 'From Filename', 'gmLang' ); ?></option>
895
+ <option value="custom"><?php _e( 'Custom', 'gmLang' ); ?></option>
896
+ </select>
897
+ <input class="form-control input-sm batch_set_custom" style="margin-top:5px;display:none;" name="batch_title_custom" value="" placeholder="<?php _e( 'Enter custom title here' ); ?>"/>
898
+ </div>
899
+ <div class="form-group">
900
+ <label><?php _e( 'Description', 'gmLang' ); ?></label>
901
+ <select class="form-control input-sm batch_set" name="batch_description">
902
+ <option value=""><?php _e( 'Skip. Do not change', 'gmLang' ); ?></option>
903
+ <option value="empty"><?php _e( 'Empty Description', 'gmLang' ); ?></option>
904
+ <option value="custom"><?php _e( 'Custom', 'gmLang' ); ?></option>
905
+ </select>
906
+
907
+ <div class="batch_set_custom" style="margin-top:5px;display:none;">
908
+ <select class="form-control input-sm" name="what_description_custom" style="margin-bottom:5px;">
909
+ <option value="replace"><?php _e( 'Replace', 'gmLang' ); ?></option>
910
+ <option value="append"><?php _e( 'Append', 'gmLang' ); ?></option>
911
+ <option value="prepend"><?php _e( 'Prepend', 'gmLang' ); ?></option>
 
 
 
 
912
  </select>
913
+ <textarea class="form-control input-sm" cols="30" rows="3" name="batch_description_custom" placeholder="<?php _e( 'Enter description here' ); ?>"></textarea>
914
  </div>
915
+ </div>
916
+ <div class="form-group">
917
+ <label><?php _e( 'Link', 'gmLang' ); ?></label>
918
+ <select class="form-control input-sm batch_set" name="batch_link">
919
+ <option value=""><?php _e( 'Skip. Do not change', 'gmLang' ); ?></option>
920
+ <option value="empty"><?php _e( 'Empty Link', 'gmLang' ); ?></option>
921
+ <option value="self"><?php _e( 'Link to original file', 'gmLang' ); ?></option>
922
+ <option value="custom"><?php _e( 'Custom', 'gmLang' ); ?></option>
923
+ </select>
924
+ <input class="form-control input-sm batch_set_custom" style="margin-top:5px;display:none;" name="batch_link_custom" value="" placeholder="<?php _e( 'Enter url here' ); ?>"/>
925
+ </div>
926
+ <div class="form-group">
927
+ <label><?php _e( 'Status', 'gmLang' ); ?></label>
928
+ <select class="form-control input-sm batch_set" name="batch_status">
929
+ <option value=""><?php _e( 'Skip. Do not change', 'gmLang' ); ?></option>
930
+ <option value="public"><?php _e( 'Public', 'gmLang' ); ?></option>
931
+ <option value="private"><?php _e( 'Private', 'gmLang' ); ?></option>
932
+ <option value="draft"><?php _e( 'Draft', 'gmLang' ); ?></option>
933
+ </select>
934
+ </div>
935
+ <?php $user_ids = current_user_can( 'gmedia_delete_others_media' ) ? $gmCore->get_editable_user_ids() : false;
936
+ if ($user_ids){
937
+ if ( ! in_array( $user_ID, $user_ids ) ) {
938
+ array_push( $user_ids, $user_ID );
939
+ }
940
+ ?>
941
+ <div class="form-group">
942
+ <label><?php _e( 'Author', 'gmLang' ); ?></label>
943
+ <?php wp_dropdown_users( array(
944
+ 'show_option_none' => __( 'Skip. Do not change', 'gmLang' ),
945
+ 'include' => $user_ids,
946
+ 'include_selected' => true,
947
+ 'name' => 'batch_author',
948
+ 'selected' => - 1,
949
+ 'class' => 'input-sm form-control'
950
+ ) );
951
+ ?>
952
+ </div>
953
+ <?php } ?>
954
+ <script type="text/javascript">
955
+ jQuery(function ($) {
956
+ $('select.batch_set').change(function () {
957
+ if ('custom' == $(this).val()) {
958
+ $(this).next().css({display: 'block'});
959
+ } else {
960
+ $(this).next().css({display: 'none'});
961
+ }
962
  });
963
+ });
964
+ </script>
965
+ <?php
966
+ break;
967
  default:
968
+ _e( 'Ops! Something wrong.', 'gmLang' );
969
  break;
970
  }
971
  ?>
972
  </div>
973
  <div class="modal-footer">
974
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php _e( 'Cancel', 'gmLang' ); ?></button>
975
+ <?php if ( $modal_button ) { ?>
976
+ <input type="hidden" name="<?php echo $modal; ?>"/>
977
  <button type="button" onclick="jQuery('#ajax-modal-form').submit()" name="<?php echo $modal; ?>" class="btn <?php echo $button_class; ?>"><?php echo $modal_button; ?></button>
978
+ <?php
979
+ }
980
+ wp_nonce_field( 'gmedia_modal' );
981
  ?>
982
  </div>
983
  </form><!-- /.modal-content -->
985
  die();
986
  }
987
 
988
+ add_action( 'wp_ajax_gmedia_tag_edit', 'gmedia_tag_edit' );
989
+ function gmedia_tag_edit() {
990
  global $gmCore, $gmDB, $gmProcessor;
991
 
992
+ check_ajax_referer( 'GmediaTerms' );
993
+ if ( ! current_user_can( 'gmedia_tag_manage' ) && ! current_user_can( 'gmedia_edit_others_media' ) ) {
994
+ $out['error'] = $gmProcessor->alert( 'danger', __( "You are not allowed to edit others media", 'gmLang' ) );
995
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
996
+ echo json_encode( $out );
997
+ die();
998
  }
999
 
1000
+ $term = array( 'taxonomy' => 'gmedia_tag' );
1001
+ $term['name'] = trim( $gmCore->_post( 'tag_name', '' ) );
1002
+ $term['term_id'] = intval( $gmCore->_post( 'tag_id', 0 ) );
1003
+ if ( $term['name'] && ! $gmCore->is_digit( $term['name'] ) ) {
1004
+ if ( ( $term_id = $gmDB->term_exists( $term['term_id'], $term['taxonomy'] ) ) ) {
1005
+ if ( ! $gmDB->term_exists( $term['name'], $term['taxonomy'] ) ) {
1006
+ $term_id = $gmDB->update_term( $term['term_id'], $term['taxonomy'], $term );
1007
+ if ( is_wp_error( $term_id ) ) {
1008
+ $out['error'] = $gmProcessor->alert( 'danger', $term_id->get_error_message() );
1009
+ } else {
1010
+ $out['msg'] = $gmProcessor->alert( 'info', sprintf( __( "Tag #%d successfuly updated", 'gmLang' ), $term_id ) );
1011
  }
1012
+ } else {
1013
+ $out['error'] = $gmProcessor->alert( 'danger', __( "A term with the name provided already exists", 'gmLang' ) );
1014
  }
1015
+ } else {
1016
+ $out['error'] = $gmProcessor->alert( 'danger', __( "A term with the id provided do not exists", 'gmLang' ) );
1017
+ }
1018
+ } else {
1019
+ $out['error'] = $gmProcessor->alert( 'danger', __( "Term name can't be only digits or empty", 'gmLang' ) );
1020
+ }
1021
+
1022
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
1023
+ echo json_encode( $out );
1024
+
1025
+ die();
1026
+
1027
+ }
1028
+
1029
+ add_action( 'wp_ajax_gmedia_module_preset_delete', 'gmedia_module_preset_delete' );
1030
+ function gmedia_module_preset_delete() {
1031
+ global $gmCore, $gmDB, $gmProcessor;
1032
+ $out = array('error' => '');
1033
+
1034
+ check_ajax_referer( 'GmediaGallery' );
1035
+ if ( ! current_user_can( 'gmedia_gallery_manage' ) ) {
1036
+ $out['error'] = $gmProcessor->alert( 'danger', __( "You are not allowed to manage galleries", 'gmLang' ) );
1037
+ } else {
1038
+ $taxonomy = 'gmedia_module';
1039
+ $term_id = intval( $gmCore->_post( 'preset_id', 0 ) );
1040
+ $delete = $gmDB->delete_term( $term_id, $taxonomy );
1041
+ if ( is_wp_error( $delete ) ) {
1042
+ $out['error'] = $delete->get_error_message();
1043
  }
 
 
1044
  }
1045
 
1046
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
1047
+ echo json_encode( $out );
1048
 
1049
  die();
1050
 
1051
  }
1052
 
1053
+ add_action( 'wp_ajax_gmedia_module_install', 'gmedia_module_install' );
1054
+ function gmedia_module_install() {
1055
  global $gmCore, $gmProcessor, $gmGallery;
1056
 
1057
+ check_ajax_referer( 'GmediaModule' );
1058
+ if ( ! current_user_can( 'gmedia_module_manage' ) ) {
1059
+ echo $gmProcessor->alert( 'danger', __( 'You are not allowed to install modules' ) );
1060
  die();
1061
  }
1062
 
1063
+ if ( ( $download = $gmCore->_post( 'download' ) ) ) {
1064
+ $module = $gmCore->_post( 'module' );
1065
+ $mzip = download_url( $download );
1066
+ if ( is_wp_error( $mzip ) ) {
1067
+ echo $gmProcessor->alert( 'danger', $mzip->get_error_message() );
1068
  die();
1069
  }
1070
 
1071
+ $mzip = str_replace( "\\", "/", $mzip );
1072
  $to_folder = $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/';
1073
+ if ( ! wp_mkdir_p( $to_folder ) ) {
1074
+ echo $gmProcessor->alert( 'danger', sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang' ), $to_folder ));
1075
+ die();
1076
+ }
1077
+ if ( ! is_writable( $to_folder ) ) {
1078
+ @chmod( $to_folder, 0755 );
1079
+ if ( ! is_writable( $to_folder ) ) {
1080
+ echo $gmProcessor->alert( 'danger', sprintf( __( 'Directory %s is not writable by the server.', 'gmLang' ), $to_folder ));
1081
+ die();
1082
+ }
1083
+ }
1084
 
1085
  global $wp_filesystem;
1086
  // Is a filesystem accessor setup?
1087
+ if ( ! $wp_filesystem || ! is_object( $wp_filesystem ) ) {
1088
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
1089
  WP_Filesystem();
1090
  }
1091
+ if ( ! is_object( $wp_filesystem ) ) {
1092
+ $result = new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.', 'flag' ) );
1093
+ } elseif ( $wp_filesystem->errors->get_error_code() ) {
1094
+ $result = new WP_Error( 'fs_error', __( 'Filesystem error', 'flag' ), $wp_filesystem->errors );
1095
+ } else {
1096
+ $result = unzip_file( $mzip, $to_folder );
1097
  }
1098
 
1099
  // Once extracted, delete the package
1100
+ unlink( $mzip );
1101
 
1102
+ if ( is_wp_error( $result ) ) {
1103
+ echo $gmProcessor->alert( 'danger', $result->get_error_message() );
1104
  die();
1105
+ } else {
1106
+ echo $gmProcessor->alert( 'success', sprintf( __( "The `%s` module successfuly installed", 'flag' ), $module ) );
1107
  }
1108
+ } else {
1109
+ echo $gmProcessor->alert( 'danger', __( 'No file specified', 'gmLang' ) );
1110
  }
1111
 
1112
  die();
1114
  }
1115
 
1116
 
1117
+ add_action( 'wp_ajax_gmedia_import_modal', 'gmedia_import_modal' );
1118
+ function gmedia_import_modal() {
1119
  global $user_ID, $gmDB, $gmCore, $gmGallery;
1120
 
1121
+ check_ajax_referer( 'GmediaGallery' );
1122
+ if ( ! current_user_can( 'gmedia_import' ) ) {
1123
+ die( '-1' );
1124
  }
1125
 
1126
  ?>
1127
  <div class="modal-content">
1128
  <div class="modal-header">
1129
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1130
+ <h4 class="modal-title"><?php _e( 'Import from WP Media Library' ); ?></h4>
1131
  </div>
1132
  <div class="modal-body" style="position:relative; min-height:270px;">
1133
  <form id="import_form" name="import_form" target="import_window" action="<?php echo $gmCore->gmedia_url; ?>/admin/import.php" method="POST" accept-charset="utf-8">
1134
+ <?php wp_nonce_field( 'GmediaImport' ); ?>
1135
+ <input type="hidden" id="import-action" name="import" value="<?php echo esc_attr( $gmCore->_post( 'modal', '' ) ); ?>"/>
1136
  <input type="hidden" name="selected" value="<?php $ckey = "gmuser_{$user_ID}_wpmedia";
1137
+ if ( isset( $_COOKIE[ $ckey ] ) ) {
1138
+ echo $_COOKIE[ $ckey ];
1139
  } ?>"/>
1140
+ <?php if ( $gmCore->caps['gmedia_terms'] ) { ?>
1141
  <div class="form-group">
1142
  <?php
1143
  $term_type = 'gmedia_category';
1144
+ $gm_terms = $gmGallery->options['taxonomies'][ $term_type ];
1145
 
1146
  $terms_category = '';
1147
+ if ( count( $gm_terms ) ) {
1148
+ foreach ( $gm_terms as $term_name => $term_title ) {
1149
+ $terms_category .= '<option value="' . $term_name . '">' . esc_html( $term_title ) . '</option>' . "\n";
1150
  }
1151
  }
1152
  ?>
1153
+ <label><?php _e( 'Assign Category', 'gmLang' ); ?>
1154
+ <small><?php _e( '(for images only)' ) ?></small>
1155
  </label>
1156
  <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
1157
+ <option value=""><?php _e( 'Uncategorized', 'gmLang' ); ?></option>
1158
  <?php echo $terms_category; ?>
1159
  </select>
1160
  </div>
1162
  <div class="form-group">
1163
  <?php
1164
  $term_type = 'gmedia_album';
1165
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'global' => array( 0, $user_ID ), 'orderby' => 'global_desc_name' ) );
1166
 
1167
  $terms_album = '';
1168
+ if ( count( $gm_terms ) ) {
1169
+ foreach ( $gm_terms as $term ) {
1170
+ $terms_album .= '<option value="' . esc_attr( $term->term_id ) . '">' . esc_html( $term->name ) . ( $term->global ? '' : __( ' (shared)', 'gmLang' ) ) . ( 'public' == $term->status ? '' : " [{$term->status}]" ) . '</option>' . "\n";
1171
  }
1172
  }
1173
  ?>
1174
+ <label><?php _e( 'Add to Album', 'gmLang' ); ?> </label>
1175
+ <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e( 'Album Name...', 'gmLang' ); ?>">
1176
  <option value=""></option>
1177
  <?php echo $terms_album; ?>
1178
  </select>
1181
  <div class="form-group">
1182
  <?php
1183
  $term_type = 'gmedia_tag';
1184
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'fields' => 'names' ) );
1185
  ?>
1186
+ <label><?php _e( 'Add Tags', 'gmLang' ); ?> </label>
1187
+ <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e( 'Add Tags...', 'gmLang' ); ?>"/>
1188
  </div>
1189
+ <?php } else { ?>
1190
+ <p><?php _e( 'You are not allowed to assign terms', 'gmLang' ) ?></p>
1191
  <?php } ?>
1192
 
1193
  <script type="text/javascript">
1194
+ jQuery(function ($) {
1195
  <?php if($gmCore->caps['gmedia_terms']){ ?>
1196
  $('#combobox_gmedia_album').selectize({
1197
  <?php if($gmCore->caps['gmedia_album_manage']){ ?>
1203
  persist: false
1204
  });
1205
  var gm_terms = <?php echo json_encode($gm_terms); ?>;
1206
+ var items = gm_terms.map(function (x) {
1207
+ return {item: x};
1208
  });
1209
  $('#combobox_gmedia_tag').selectize({
1210
  <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
1211
+ create: function (input) {
1212
  return {
1213
  item: input
1214
  }
1228
  });
1229
  <?php } ?>
1230
 
1231
+ $('#import-done').one('click', function (e) {
1232
  $('#import_form').submit();
1233
+ $(this).text($(this).data('loading-text')).prop('disabled', true);
1234
  $('#import_window').show();
1235
+ $(this).one('click', function (e) {
1236
  $('#importModal').modal('hide');
1237
  });
1238
  });
1243
  <iframe name="import_window" id="import_window" src="about:blank" style="display:none; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1000; background-color:#ffffff; padding:20px 20px 0 20px;" onload="gmedia_import_done()"></iframe>
1244
  </div>
1245
  <div class="modal-footer">
1246
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php _e( 'Cancel', 'gmLang' ); ?></button>
1247
+ <button type="button" id="import-done" class="btn btn-primary" data-complete-text="<?php _e( 'Close', 'gmLang' ); ?>" data-loading-text="<?php _e( 'Working...', 'gmLang' ); ?>" data-reset-text="<?php _e( 'Import', 'gmLang' ); ?>"><?php _e( 'Import', 'gmLang' ); ?></button>
1248
  </div>
1249
  </div><!-- /.modal-content -->
1250
  <?php
1251
  die();
1252
  }
1253
 
1254
+ add_action( 'wp_ajax_gmedia_relimage', 'gmedia_relimage' );
1255
  /**
1256
  * Do Actions via Ajax
1257
  * TODO add related images to post
1259
  *
1260
  * @return void
1261
  */
1262
+ function gmedia_relimage() {
1263
  /** @var $wpdb wpdb */
1264
  global $wpdb, $gmCore, $gmDB;
1265
 
1266
+ check_ajax_referer( "grandMedia" );
1267
 
1268
  // check for correct capability
1269
+ if ( ! current_user_can( 'gmedia_library' ) ) {
1270
+ die( '-1' );
1271
  }
1272
 
1273
+ $post_tags = array_filter( array_map( 'trim', explode( ',', stripslashes( urldecode( $gmCore->_get( 'tags', '' ) ) ) ) ) );
1274
+ $paged = (int) $gmCore->_get( 'paged', 1 );
1275
+ $per_page = 20;
1276
+ $s = trim( stripslashes( urldecode( $gmCore->_get( 'search' ) ) ) );
1277
+ if ( $s && strlen( $s ) > 2 ) {
1278
  $post_tags = array();
1279
+ } else {
1280
  $s = '';
1281
  }
1282
 
1283
  $gmediaLib = array();
1284
+ $relative = (int) $gmCore->_get( 'rel', 1 );
1285
+ $continue = true;
1286
+ $content = '';
1287
+
1288
+ if ( $relative == 1 ) {
1289
+ $arg = array(
1290
+ 'mime_type' => 'image/*',
1291
+ 'orderby' => 'ID',
1292
+ 'order' => 'DESC',
1293
+ 'per_page' => $per_page,
1294
+ 'page' => $paged,
1295
+ 's' => $s,
1296
  'tag_name__in' => $post_tags,
1297
+ 'null_tags' => true
1298
  );
1299
+ $gmediaLib = $gmDB->get_gmedias( $arg );
1300
  }
1301
 
1302
+ if ( empty( $gmediaLib ) && count( $post_tags ) ) {
1303
 
1304
+ if ( $relative == 1 ) {
1305
  $relative = 0;
1306
+ $paged = 1;
1307
+ $content .= '<li class="emptydb">' . __( 'No items related by tags.', 'gmLang' ) . '</li>' . "\n";
1308
  }
1309
 
1310
+ $tag__not_in = "'" . implode( "','", array_map( 'esc_sql', array_unique( (array) $post_tags ) ) ) . "'";
1311
+ $tag__not_in = $wpdb->get_col( "
1312
  SELECT term_id
1313
  FROM {$wpdb->prefix}gmedia_term
1314
  WHERE taxonomy = 'gmedia_tag'
1315
  AND name IN ({$tag__not_in})
1316
+ " );
1317
+
1318
+ $arg = array(
1319
+ 'mime_type' => 'image/*',
1320
+ 'orderby' => 'ID',
1321
+ 'order' => 'DESC',
1322
+ 'per_page' => $per_page,
1323
+ 'page' => $paged,
1324
  'tag__not_in' => $tag__not_in
1325
  );
1326
+ $gmediaLib = $gmDB->get_gmedias( $arg );
1327
  }
1328
 
1329
+ if ( ( $count = count( $gmediaLib ) ) ) {
1330
+ foreach ( $gmediaLib as $item ) {
1331
  $content .= "<li class='gmedia-image-li' id='gm-img-{$item->ID}'>\n";
1332
+ $content .= " <a target='_blank' class='gm-img' data-gmid='{$item->ID}' href='" . $gmCore->gm_get_media_image( $item ) . "'><img src='" . $gmCore->gm_get_media_image( $item, 'thumb' ) . "' height='50' style='width:auto;' alt='' title='" . esc_attr( $item->title ) . "' /></a>\n";
1333
+ $content .= " <div style='display: none;' class='gm-img-description'>" . esc_html( $item->description ) . "</div>\n";
1334
  $content .= "</li>\n";
1335
  }
1336
+ if ( ( $count < $per_page ) && ( $relative == 0 || ! empty( $s ) ) ) {
1337
  $continue = false;
1338
  }
1339
+ } else {
1340
+ if ( $s ) {
1341
+ $content .= '<li class="emptydb">' . __( 'No items matching the search query.', 'gmLang' ) . '</li>' . "\n";
1342
+ } else {
1343
+ $content .= '<li class="emptydb">' . __( 'No items to show', 'gmLang' ) . '</li>' . "\n";
1344
  }
1345
  $continue = false;
1346
  }
1347
+ $result = array( 'paged' => $paged, 'rel' => $relative, 'continue' => $continue, 'content' => $content, 'data' => $post_tags );
1348
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
1349
+ echo json_encode( $result );
1350
 
1351
  die();
1352
 
1353
  }
1354
 
1355
+ add_action( 'wp_ajax_gmedia_ftp_browser', 'gmedia_ftp_browser' );
1356
  /**
1357
  * jQuery File Tree PHP Connector
1358
  * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
1360
  *
1361
  * @return string folder content
1362
  */
1363
+ function gmedia_ftp_browser() {
1364
+ if ( ! current_user_can( 'gmedia_import' ) ) {
1365
+ die( 'No access' );
1366
  }
1367
 
1368
  // if nonce is not correct it returns -1
1369
+ check_ajax_referer( 'grandMedia' );
1370
 
1371
  // start from the default path
1372
+ $root = trailingslashit( ABSPATH );
1373
  // get the current directory
1374
+ $dir = trailingslashit( urldecode( $_POST['dir'] ) );
1375
 
1376
+ if ( file_exists( $root . $dir ) ) {
1377
+ $files = scandir( $root . $dir );
1378
+ natcasesort( $files );
1379
 
1380
  // The 2 counts for . and ..
1381
+ if ( count( $files ) > 2 ) {
1382
  echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
1383
  // return only directories
1384
+ foreach ( $files as $file ) {
1385
+ if ( in_array( $file, array( 'wp-admin', 'wp-includes', 'plugins', 'themes', 'thumb', 'thumbs' ) ) ) {
1386
  continue;
1387
  }
1388
 
1389
+ if ( file_exists( $root . $dir . $file ) && $file != '.' && $file != '..' && is_dir( $root . $dir . $file ) ) {
1390
+ echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_attr( $dir . $file ) . "/\">" . esc_html( $file ) . "</a></li>";
1391
  }
1392
  }
1393
  echo "</ul>";
1396
 
1397
  die();
1398
  }
1399
+
1400
+ add_action( 'wp_ajax_gmedia_set_post_thumbnail', 'gmedia_set_post_thumbnail' );
1401
+ function gmedia_set_post_thumbnail() {
1402
+ global $gmCore, $gmDB, $gmGallery;
1403
+
1404
+ $post_ID = intval( $gmCore->_post( 'post_id', 0 ) );
1405
+
1406
+ if ( ! $post_ID || ! current_user_can( 'edit_post', $post_ID ) ) {
1407
+ die( '-1' );
1408
+ }
1409
+
1410
+ // if nonce is not correct it returns -1
1411
+ check_ajax_referer( 'set_post_thumbnail-' . $post_ID );
1412
+
1413
+ $img_id = intval( $gmCore->_post( 'img_id', 0 ) );
1414
+
1415
+ /*
1416
+ // delete the image
1417
+ if ( $thumbnail_id == '-1' ) {
1418
+ delete_post_meta( $post_ID, '_thumbnail_id' );
1419
+ die('0');
1420
+ }
1421
+ */
1422
+
1423
+ if ( $img_id ) {
1424
+
1425
+ $image = $gmDB->get_gmedia( $img_id );
1426
+ if ( $image ) {
1427
+
1428
+ $args = array(
1429
+ 'post_type' => 'attachment',
1430
+ 'meta_key' => '_gmedia_image_id',
1431
+ 'meta_compare' => '==',
1432
+ 'meta_value' => $img_id
1433
+ );
1434
+ $posts = get_posts( $args );
1435
+ $attachment_id = null;
1436
+
1437
+ if ( $posts != null ) {
1438
+ $attachment_id = $posts[0]->ID;
1439
+ $target_path = get_attached_file( $attachment_id );
1440
+ } else {
1441
+ $upload_dir = wp_upload_dir();
1442
+ $basedir = $upload_dir['basedir'];
1443
+ $thumbs_dir = implode( DIRECTORY_SEPARATOR, array( $basedir, 'gmedia_featured' ) );
1444
+
1445
+ $type = explode( '/', $image->mime_type );
1446
+
1447
+ $url = $gmCore->upload['url'] . '/' . $gmGallery->options['folder'][ $type[0] ] . '/' . $image->gmuid;
1448
+ $image_abspath = $gmCore->upload['path'] . '/' . $gmGallery->options['folder'][ $type[0] ] . '/' . $image->gmuid;
1449
+
1450
+ $img_name = current_time( 'ymd_Hi' ) . '_' . basename( $image->gmuid );
1451
+ $target_path = path_join( $thumbs_dir, $img_name );
1452
+ wp_mkdir_p( $thumbs_dir );
1453
+
1454
+ if ( @copy( $image_abspath, $target_path ) ) {
1455
+ $title = sanitize_title( $image->title );
1456
+ $caption = $gmCore->sanitize( $image->description );
1457
+
1458
+ $attachment = array(
1459
+ 'post_title' => $title,
1460
+ 'post_content' => $caption,
1461
+ 'post_status' => 'attachment',
1462
+ 'post_parent' => 0,
1463
+ 'post_mime_type' => $image->mime_type,
1464
+ 'guid' => $url
1465
+ );
1466
+
1467
+ //require for wp_generate_attachment_metadata which generates image related meta-data also creates thumbs
1468
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
1469
+ // Save the data
1470
+ $attachment_id = wp_insert_attachment( $attachment, $target_path );
1471
+ wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $target_path ) );
1472
+ add_post_meta( $attachment_id, '_gmedia_image_id', $img_id, true );
1473
+ }
1474
+ }
1475
+
1476
+ if ( $attachment_id ) {
1477
+ delete_post_meta( $post_ID, '_thumbnail_id' );
1478
+ add_post_meta( $post_ID, '_thumbnail_id', $attachment_id, true );
1479
+
1480
+ echo _wp_post_thumbnail_html( $attachment_id, $post_ID );
1481
+ die();
1482
+ }
1483
+ }
1484
+ }
1485
+
1486
+ die( '0' );
1487
+ }
1488
+
admin/css/grand-media.css CHANGED
@@ -89,6 +89,7 @@ input.pager_current_page {
89
  .txt-lg { font-size:120%; line-height:50%; }
90
  a.text-danger{ color:#a94442; }
91
  .btn > input[type="checkbox"] { margin-top:0; width:16px; height:16px; }
 
92
 
93
  .gm-checkgroup { margin-right:20px; }
94
 
@@ -104,8 +105,8 @@ div#gm-list-table { font-size:13px; }
104
  .no-touch form.list-group-item.d-row:hover { background-color:#fcfcfc; }
105
  .list-group-item.d-row.active { color:#444; border-color: #ddd; background-color:rgb(250, 255, 245); box-shadow:inset -1px 0 0 2px rgb(250, 255, 245), inset 7px 0 0 0 #1e8cbe; }
106
  .no-touch .list-group-item.d-row.active:hover { color:#444; border-color: #ddd; background-color:rgb(245, 255, 240); box-shadow:inset -1px 0 0 2px rgb(245, 255, 240), inset 7px 0 0 0 #1e8cbe; }
107
- .list-group-item-info { background-color: #d9edf7 !important; }
108
- .list-group-item-warning { background-color: #fcf8e3 !important; }
109
  .bg-status-private { background-color: #d9edf7; box-shadow:3px 0 0 5px #d9edf7, -2px 0 0 5px #6fbfff; }
110
  .bg-status-draft { background-color: #fcf8e3; box-shadow:3px 0 0 5px #fcf8e3, -2px 0 0 5px #ffd87c; }
111
 
@@ -123,7 +124,8 @@ div.li_media-object { margin-right:15px; padding-left:15px; float:left; width:31
123
  .gmedia_id { position:absolute; right:10px; top:10px; }
124
  .no-touch .gmedia_id,
125
  .no-touch .term_id { display:none; }
126
- .term_id { position:absolute; right:0; top:0; padding: 10px 10px 0 0px; background-color:#fff; display:none; height:100%; box-shadow: -10px 0 5px -2px #fff; z-index:100; }
 
127
  .no-touch #gm-list-table .list-group-item:hover .gmedia_id,
128
  .no-touch #gm-list-table .list-group-item:hover .term_id { display:block; }
129
 
@@ -139,7 +141,8 @@ form.changed .gm-last-edited { text-decoration:line-through; }
139
  .rel-selected-hide { display:none; }
140
 
141
  div#pluploadUploader { padding:0; }
142
- div#pluploadUploader * { box-sizing:content-box; }
 
143
  .plupload_container { padding:0; }
144
  div#pluploadUploader_container { min-height: 450px; border-bottom-right-radius: 4px; }
145
  div#pluploadUploader_container .plupload_filelist_footer { border-bottom-right-radius: 4px; }
@@ -158,7 +161,7 @@ div#gmedia-msg-panel .alert { padding:2px 35px 2px 12px; margin-bottom:5px; }
158
  .selectize-control.input-sm .selectize-input:after { right: 10px; }
159
 
160
  .term-list-item {padding-top:0; padding-bottom:0;}
161
- .term-list-item .term-label .checkbox {padding-left:35px;}
162
  .term-list-item .term-label .checkbox > input {margin-left:-35px;}
163
  .term-list-item .checkbox input {margin-top:0; margin-right:15px;}
164
  .term-list-item .term-description {padding:1px 0 4px; white-space:nowrap; overflow:hidden; color:#444444;}
@@ -197,23 +200,57 @@ a.edit_tag_save.btn {padding-top:0;padding-bottom:0;}
197
  .termItems .gm-img-thumbnail {width:160px;height:120px;text-align:center;line-height:107px;}
198
  .termItems .gm-img-thumbnail img {height:auto;width:auto;max-width:100%;max-height:100%;display:inline-block;vertical-align:middle;}
199
 
200
- .choose-module {padding:10px;cursor:pointer;}
201
  .no-touch .choose-module:hover {background-color:#d0e9c6;}
202
  .choose-module .thumbnail {margin-bottom:0;}
 
 
203
 
 
 
 
204
 
205
- body#media-upload { height:100%; overflow:auto; margin:0; padding:0 }
206
- body#media-upload .panel {position:relative; height:100%; overflow:auto; margin:0; border-top-left-radius: 0; border-top-right-radius: 0; border-top:none;}
207
  body#media-upload .panel-heaading {position:relative; z-index:100;}
208
  body#media-upload .panel-body {position:absolute; top:55px; bottom:0; width:100%; overflow:hidden; z-index:50; padding-top:0; padding-bottom:0;}
209
- body#media-upload .panel-body .row {height:100%;}
210
- body#media-upload .panel-body .row > div {height:100%; overflow:auto; padding-top:15px; padding-bottom:15px;}
211
- body#media-upload .media-upload-sidebar {border-left:1px solid #cccccc; background-color:#eeeeee; padding-bottom:55px;position:relative;}
212
- body#media-upload .media-upload-sidebar .panel-footer {position:absolute; left:0; bottom:0; right:0;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  body#media-upload .thumbnail {margin:0 5px 5px 0; position:relative; display:inline-block;}
214
  body#media-upload .thumbnail.active {background-color:lightblue;border-color:cadetblue;}
215
  body#media-upload .thumbnail .glyphicon {display:none; position:absolute; right:-3px; top:-7px; font-size:30px;}
216
  body#media-upload .thumbnail.active .glyphicon {display:inline-block;}
 
 
 
 
217
 
218
  body.gmedia-blank.image_editor { height:100%; overflow:auto; margin:0; padding:0 }
219
  body.gmedia-blank.image_editor .panel {position:relative; height:100%; overflow:auto; margin:0;}
89
  .txt-lg { font-size:120%; line-height:50%; }
90
  a.text-danger{ color:#a94442; }
91
  .btn > input[type="checkbox"] { margin-top:0; width:16px; height:16px; }
92
+ .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background-color: #e8e8e8; }
93
 
94
  .gm-checkgroup { margin-right:20px; }
95
 
105
  .no-touch form.list-group-item.d-row:hover { background-color:#fcfcfc; }
106
  .list-group-item.d-row.active { color:#444; border-color: #ddd; background-color:rgb(250, 255, 245); box-shadow:inset -1px 0 0 2px rgb(250, 255, 245), inset 7px 0 0 0 #1e8cbe; }
107
  .no-touch .list-group-item.d-row.active:hover { color:#444; border-color: #ddd; background-color:rgb(245, 255, 240); box-shadow:inset -1px 0 0 2px rgb(245, 255, 240), inset 7px 0 0 0 #1e8cbe; }
108
+ div#gmedia-container .list-group-item-info { background-color: #d9edf7 !important; }
109
+ div#gmedia-container .list-group-item-warning { background-color: #fcf8e3 !important; }
110
  .bg-status-private { background-color: #d9edf7; box-shadow:3px 0 0 5px #d9edf7, -2px 0 0 5px #6fbfff; }
111
  .bg-status-draft { background-color: #fcf8e3; box-shadow:3px 0 0 5px #fcf8e3, -2px 0 0 5px #ffd87c; }
112
 
124
  .gmedia_id { position:absolute; right:10px; top:10px; }
125
  .no-touch .gmedia_id,
126
  .no-touch .term_id { display:none; }
127
+ .term_id { position:absolute; right:0; top:0; padding: 10px 10px 0 0; background-color:#fff; display:none; height:100%; box-shadow: -10px 0 5px -2px #fff; z-index:100; }
128
+ .term-list-item.active .term_id { background-color:#428bca; box-shadow: -10px 0 3px -2px #428bca; display: block;}
129
  .no-touch #gm-list-table .list-group-item:hover .gmedia_id,
130
  .no-touch #gm-list-table .list-group-item:hover .term_id { display:block; }
131
 
141
  .rel-selected-hide { display:none; }
142
 
143
  div#pluploadUploader { padding:0; }
144
+ div#pluploadUploader * { box-sizing:border-box; }
145
+ div#pluploadUploader > div > div * { box-sizing:content-box; }
146
  .plupload_container { padding:0; }
147
  div#pluploadUploader_container { min-height: 450px; border-bottom-right-radius: 4px; }
148
  div#pluploadUploader_container .plupload_filelist_footer { border-bottom-right-radius: 4px; }
161
  .selectize-control.input-sm .selectize-input:after { right: 10px; }
162
 
163
  .term-list-item {padding-top:0; padding-bottom:0;}
164
+ .term-list-item .term-label .checkbox {padding-left:35px; min-height: 40px;}
165
  .term-list-item .term-label .checkbox > input {margin-left:-35px;}
166
  .term-list-item .checkbox input {margin-top:0; margin-right:15px;}
167
  .term-list-item .term-description {padding:1px 0 4px; white-space:nowrap; overflow:hidden; color:#444444;}
200
  .termItems .gm-img-thumbnail {width:160px;height:120px;text-align:center;line-height:107px;}
201
  .termItems .gm-img-thumbnail img {height:auto;width:auto;max-width:100%;max-height:100%;display:inline-block;vertical-align:middle;}
202
 
203
+ .choose-module {padding:10px;cursor:pointer;overflow: hidden;margin: 0;}
204
  .no-touch .choose-module:hover {background-color:#d0e9c6;}
205
  .choose-module .thumbnail {margin-bottom:0;}
206
+ .media { overflow: hidden; }
207
+ .media > .thumbnail.pull-left {padding: 4px; margin-right: 10px}
208
 
209
+ .presetlist a {position: relative;padding-right: 30px;}
210
+ .delpreset { position: absolute; right: 0; top: 0; bottom: 0; padding: 0.8em 7px 0; line-height: 100%;}
211
+ .delpreset span { line-height: 100%; font-size: 94%; padding: 0 5px 2px; cursor: pointer;}
212
 
213
+ body#media-upload { height:100%; overflow:auto; margin:0; padding:0; background: #ffffff; }
214
+ body#media-upload .panel {position:relative; height:100%; overflow:auto; margin:0; border-radius: 0; border-top:none;}
215
  body#media-upload .panel-heaading {position:relative; z-index:100;}
216
  body#media-upload .panel-body {position:absolute; top:55px; bottom:0; width:100%; overflow:hidden; z-index:50; padding-top:0; padding-bottom:0;}
217
+ body#media-upload .panel-body > .row {height:100%;}
218
+ body#media-upload .panel-body > .row > div {height:100%; overflow:auto; padding-top:15px; padding-bottom:15px;}
219
+ body#media-upload .panel-body .list-group-item {border-width: 0; border-top-width: 1px; margin: 0;}
220
+ body#media-upload .panel-body .list-group-item:first-child {border-width: 0;}
221
+ body#media-upload .term-list-item .term-label .no-checkbox {display: inline-block; width: 100%;}
222
+ body#media-upload .term-list-item .term-info {display: none;}
223
+ .blank-aligner {display: inline-block; height: 40px; vertical-align: middle; width: 1px; overflow: hidden; margin-right: -2em;}
224
+
225
+ body#media-upload .media-upload-sidebar {border-left:1px solid #cccccc; background-color:#eeeeee; padding:0 !important;position:relative;}
226
+ body#media-upload .media-upload-sidebar form {
227
+ display: -webkit-box;
228
+ display: -moz-box;
229
+ display: -ms-flexbox;
230
+ display: -webkit-flex;
231
+ display: flex;
232
+ -webkit-flex-direction: column;
233
+ -moz-flex-direction: column;
234
+ -ms-flex-direction: column;
235
+ -webkit-flex-direction: column;
236
+ flex-direction: column;
237
+ height: 100%; width: 100%;}
238
+ body#media-upload .media-upload-sidebar .media-upload-form-container {
239
+ -webkit-box-flex: 1 auto;
240
+ -moz-box-flex: 1 auto;
241
+ -webkit-flex: 1 auto;
242
+ -ms-flex: 1 auto;
243
+ flex: 1 auto;
244
+ overflow: auto; padding: 15px;}
245
+ body#media-upload .media-upload-sidebar .panel-footer {min-height: 57px;}
246
  body#media-upload .thumbnail {margin:0 5px 5px 0; position:relative; display:inline-block;}
247
  body#media-upload .thumbnail.active {background-color:lightblue;border-color:cadetblue;}
248
  body#media-upload .thumbnail .glyphicon {display:none; position:absolute; right:-3px; top:-7px; font-size:30px;}
249
  body#media-upload .thumbnail.active .glyphicon {display:inline-block;}
250
+ body#media-upload .plupload_wrapper {height: 100%; box-sizing: border-box;}
251
+ body#media-upload div#pluploadUploader .plupload_container {height: 100%; min-height: inherit !important;}
252
+ body#media-upload .ui-resizable-handle {display: none !important; bottom: -1px;}
253
+ #gmedia-post-thumbnail {font-size: 12px;padding: 0;display: inline;white-space: normal;}
254
 
255
  body.gmedia-blank.image_editor { height:100%; overflow:auto; margin:0; padding:0 }
256
  body.gmedia-blank.image_editor .panel {position:relative; height:100%; overflow:auto; margin:0;}
admin/css/meta-box.css CHANGED
@@ -301,10 +301,4 @@ div#gmedia-galleries .ui-resizable-s {
301
  text-decoration: none;
302
  }
303
 
304
- .wp-media-buttons .gmedia_button { padding-left: .4em; }
305
- .wp-media-buttons .gmedia_button.hidden { display: inline-block !important; }
306
- .wp-media-buttons .gmedia_button span.wp-media-buttons-icon {
307
- background: url(../images/gm-icon.png) no-repeat top left;
308
- }
309
-
310
  .ui-dialog.gmedia-tool-dialog .ui-dialog-content { overflow: hidden !important; }
301
  text-decoration: none;
302
  }
303
 
 
 
 
 
 
 
304
  .ui-dialog.gmedia-tool-dialog .ui-dialog-content { overflow: hidden !important; }
admin/galleries.php CHANGED
@@ -73,8 +73,13 @@ function gmediaGalleries(){
73
  <div class="panel-heading clearfix">
74
  <form class="form-inline gmedia-search-form" role="search" method="get">
75
  <div class="form-group">
76
- <input type="hidden" name="page" value="<?php echo $gmProcessor->page; ?>"/>
77
- <input type="hidden" name="term" value="<?php echo $taxonomy; ?>"/>
 
 
 
 
 
78
  <input id="gmedia-search" class="form-control input-sm" type="text" name="s" placeholder="<?php _e('Search...', 'gmLang'); ?>" value="<?php echo $gmCore->_get('s', ''); ?>"/>
79
  </div>
80
  <button type="submit" class="btn btn-default input-sm"><span class="glyphicon glyphicon-search"></span></button>
@@ -160,8 +165,17 @@ function gmediaGalleries(){
160
  }
161
 
162
  $is_selected = in_array($term->term_id, $gmProcessor->selected_items)? true : false;
 
 
 
 
 
 
 
 
 
163
  ?>
164
- <div class="list-group-item row d-row<?php echo $is_selected? ' active' : ''; ?>" id="list-item-<?php echo $term->term_id; ?>" data-id="<?php echo $term->term_id; ?>" data-type="<?php echo $term_meta['module']; ?>">
165
  <div class="term_id">#<?php echo $term->term_id; ?></div>
166
  <div class="col-xs-7">
167
  <label class="cb_media-object" style="width:130px;">
@@ -374,13 +388,14 @@ function gmediaGalleryEdit(){
374
  }
375
  } elseif($module_name){
376
  $url = add_query_arg(array('page' => $gmProcessor->page, 'gallery_module' => $module_name), admin_url('admin.php'));
377
- $error_post = $gmCore->_post('gallery');
378
- if($error_post){
379
- $gallery = $gmCore->array_replace_recursive($gallery, $error_post);
380
- }
381
  $gallery['module'] = $module_name;
382
  }
383
 
 
 
 
 
 
384
  if(!empty($alert)){
385
  echo $gmProcessor->alert('danger', $alert);
386
  gmediaGalleries();
@@ -413,6 +428,10 @@ function gmediaGalleryEdit(){
413
  }
414
 
415
  $default_options = array();
 
 
 
 
416
  /**
417
  * @var $place
418
  * @var $module_name
@@ -420,6 +439,21 @@ function gmediaGalleryEdit(){
420
  * @var $module_path
421
  */
422
  if($module_name){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  if(isset($modules[$module_name])){
424
  extract($modules[$module_name]);
425
 
@@ -432,6 +466,10 @@ function gmediaGalleryEdit(){
432
  if(file_exists($module_path . '/index.php') && file_exists($module_path . '/settings.php')){
433
  include($module_path . '/index.php');
434
  include($module_path . '/settings.php');
 
 
 
 
435
  } else{
436
  $alert[] = sprintf(__('Module `%s` is broken. Choose another module from the list and save settings'), $module_name);
437
  }
@@ -446,6 +484,10 @@ function gmediaGalleryEdit(){
446
  echo $gmProcessor->alert('danger', $alert);
447
  }
448
 
 
 
 
 
449
  if(isset($gallery['settings'][$module_name])){
450
  $gallery_settings = $gmCore->array_replace_recursive($default_options, $gallery['settings'][$module_name]);
451
  } else{
@@ -463,7 +505,7 @@ function gmediaGalleryEdit(){
463
  <a href="<?php echo add_query_arg(array('page' => 'GrandMedia_Galleries'), admin_url('admin.php')); ?>" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span> <?php _e('Manage Galleries', 'gmLang'); ?>
464
  </a>
465
  </div>
466
- <div class="btn-group">
467
  <?php if($gallery['module'] != $module_name){ ?>
468
  <a href="<?php echo $url; ?>" class="btn btn-default"><?php _e('Cancel preview module', 'gmLang'); ?></a>
469
  <button type="submit" name="gmedia_gallery_save" class="btn btn-primary"><?php _e('Save with new module', 'gmLang'); ?></button>
@@ -477,6 +519,44 @@ function gmediaGalleryEdit(){
477
  <?php } ?>
478
  </div>
479
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
480
  </div>
481
  <div class="panel-body" id="gmedia-msg-panel"></div>
482
  <div class="panel-body" id="gmedia-edit-gallery" style="margin-bottom:4px; padding-top:0;">
@@ -512,7 +592,7 @@ function gmediaGalleryEdit(){
512
  } ?></p>
513
 
514
  <p><b><?php _e('Gallery author:', 'gmLang'); ?></b>
515
- <?php if($gmCore->caps['gmedia_edit_others_media']){ ?>
516
  <a href="#gallModal" data-modal="filter_authors" data-action="gmedia_get_modal" class="gmedia-modal" title="<?php _e('Click to choose author for gallery', 'gmLang'); ?>"><?php echo $gallery['global']? get_the_author_meta('display_name', $gallery['global']) : __('(no author / shared albums)'); ?></a>
517
  <?php if($author_new){
518
  echo '<br /><span class="text-danger">' . __('Note: Author changed but not saved yet. You can see Albums list only of chosen author') . '</span>';
@@ -534,11 +614,8 @@ function gmediaGalleryEdit(){
534
  <label><?php _e('Status', 'gmLang'); ?></label>
535
  <select name="gallery[status]" class="form-control input-sm">
536
  <option value="public"<?php selected($gallery['status'], 'public'); ?>><?php _e('Public', 'gmLang'); ?></option>
537
- <?php /* ?>
538
- <option value="private"<?php selected($gallery['status'], 'private'); ?>><?php _e('Private', 'gmLang'); ?></option>
539
- <option value="draft"<?php selected($gallery['status'], 'draft'); ?>><?php _e('Draft', 'gmLang'); ?></option>
540
- <?php */
541
- ?>
542
  </select>
543
  </div>
544
  <div class="form-group">
73
  <div class="panel-heading clearfix">
74
  <form class="form-inline gmedia-search-form" role="search" method="get">
75
  <div class="form-group">
76
+ <?php foreach($_GET as $key => $value){
77
+ if(in_array($key, array('orderby', 'order', 'number', 'global'))){
78
+ ?>
79
+ <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>"/>
80
+ <?php
81
+ }
82
+ } ?>
83
  <input id="gmedia-search" class="form-control input-sm" type="text" name="s" placeholder="<?php _e('Search...', 'gmLang'); ?>" value="<?php echo $gmCore->_get('s', ''); ?>"/>
84
  </div>
85
  <button type="submit" class="btn btn-default input-sm"><span class="glyphicon glyphicon-search"></span></button>
165
  }
166
 
167
  $is_selected = in_array($term->term_id, $gmProcessor->selected_items)? true : false;
168
+
169
+ $list_row_class = '';
170
+ if ('public' != $term->status) {
171
+ if('private' == $term->status){
172
+ $list_row_class = ' list-group-item-info';
173
+ } elseif('draft' == $term->status){
174
+ $list_row_class = ' list-group-item-warning';
175
+ }
176
+ }
177
  ?>
178
+ <div class="list-group-item row d-row<?php echo $list_row_class . ($is_selected? ' active' : ''); ?>" id="list-item-<?php echo $term->term_id; ?>" data-id="<?php echo $term->term_id; ?>" data-type="<?php echo $term_meta['module']; ?>">
179
  <div class="term_id">#<?php echo $term->term_id; ?></div>
180
  <div class="col-xs-7">
181
  <label class="cb_media-object" style="width:130px;">
388
  }
389
  } elseif($module_name){
390
  $url = add_query_arg(array('page' => $gmProcessor->page, 'gallery_module' => $module_name), admin_url('admin.php'));
 
 
 
 
391
  $gallery['module'] = $module_name;
392
  }
393
 
394
+ $gallery_post = $gmCore->_post('gallery');
395
+ if($gallery_post){
396
+ $gallery = $gmCore->array_replace_recursive($gallery, $gallery_post);
397
+ }
398
+
399
  if(!empty($alert)){
400
  echo $gmProcessor->alert('danger', $alert);
401
  gmediaGalleries();
428
  }
429
 
430
  $default_options = array();
431
+ $presets = false;
432
+ $default_preset = array();
433
+ $load_preset = array();
434
+
435
  /**
436
  * @var $place
437
  * @var $module_name
439
  * @var $module_path
440
  */
441
  if($module_name){
442
+ $presets = $gmDB->get_terms('gmedia_module', array('global' => $user_ID, 'status' => $module_name));
443
+ foreach($presets as $i => $preset){
444
+ if('['.$module_name.']' == $preset->name){
445
+ $default_preset = maybe_unserialize($preset->description);
446
+ $default_preset['term_id'] = $preset->term_id;
447
+ $default_preset['name'] = $preset->name;
448
+ unset($presets[$i]);
449
+ }
450
+ if((int) $preset->term_id == (int) $gmCore->_get('preset', 0)){
451
+ $load_preset = maybe_unserialize($preset->description);
452
+ $load_preset['term_id'] = $preset->term_id;
453
+ $load_preset['name'] = $preset->name;
454
+ }
455
+ }
456
+
457
  if(isset($modules[$module_name])){
458
  extract($modules[$module_name]);
459
 
466
  if(file_exists($module_path . '/index.php') && file_exists($module_path . '/settings.php')){
467
  include($module_path . '/index.php');
468
  include($module_path . '/settings.php');
469
+
470
+ if(!empty($default_preset)){
471
+ $default_options = $gmCore->array_replace_recursive($default_options, $default_preset);
472
+ }
473
  } else{
474
  $alert[] = sprintf(__('Module `%s` is broken. Choose another module from the list and save settings'), $module_name);
475
  }
484
  echo $gmProcessor->alert('danger', $alert);
485
  }
486
 
487
+ if(!empty($load_preset)){
488
+ $gallery['settings'][$module_name] = $gmCore->array_replace_recursive($gallery['settings'][$module_name], $load_preset);
489
+ echo $gmProcessor->alert('info', sprintf(__('Preset `%s` loaded. To apply it for current gallery click Save button'), $load_preset['name']));
490
+ }
491
  if(isset($gallery['settings'][$module_name])){
492
  $gallery_settings = $gmCore->array_replace_recursive($default_options, $gallery['settings'][$module_name]);
493
  } else{
505
  <a href="<?php echo add_query_arg(array('page' => 'GrandMedia_Galleries'), admin_url('admin.php')); ?>" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span> <?php _e('Manage Galleries', 'gmLang'); ?>
506
  </a>
507
  </div>
508
+ <div class="btn-group" id="save_buttons">
509
  <?php if($gallery['module'] != $module_name){ ?>
510
  <a href="<?php echo $url; ?>" class="btn btn-default"><?php _e('Cancel preview module', 'gmLang'); ?></a>
511
  <button type="submit" name="gmedia_gallery_save" class="btn btn-primary"><?php _e('Save with new module', 'gmLang'); ?></button>
519
  <?php } ?>
520
  </div>
521
  </div>
522
+ <div class="btn-toolbar pull-right" id="module_preset">
523
+ <div class="btn-group">
524
+ <button type="button" class="btn btn-default" id="save_preset" data-toggle="popover"><?php _e('Module Presets', 'gmLang'); ?></button>
525
+ </div>
526
+ <script type="text/html" id="_save_preset">
527
+ <div style="padding-top: 5px;">
528
+ <p style="white-space: nowrap">
529
+ <button type="submit" name="module_preset_save_default" class="ajax-submit btn btn-default btn-sm"><?php _e('Save as Default', 'gmLang'); ?></button>
530
+ &nbsp; <em><?php _e('or', 'gmLang'); ?></em> &nbsp;
531
+ <?php if(!empty($default_preset)){ ?>
532
+ <button type="submit" name="module_preset_restore_original" class="ajax-submit btn btn-default btn-sm"><?php _e('Restore Original', 'gmLang'); ?></button>
533
+ <input type="hidden" name="preset_default" value="<?php echo $default_preset['term_id']; ?>" />
534
+ <?php } ?>
535
+ </p>
536
+ <div class="form-group clearfix" style="border-top: 1px solid #444444; padding-top: 5px;">
537
+ <label><?php _e('Save Preset as:', 'gmLang'); ?></label>
538
+ <div class="input-group input-group-sm">
539
+ <input type="text" class="form-control input-sm" name="module_preset_name" placeholder="<?php _e('Preset Name', 'gmLang'); ?>" value="" />
540
+ <span class="input-group-btn"><button type="submit" name="module_preset_save_as" class="ajax-submit btn btn-primary"><?php _e('Save', 'gmLang'); ?></button></span>
541
+ </div>
542
+ </div>
543
+
544
+ <?php if(!empty($presets)){ ?>
545
+ <ul class="list-group presetlist">
546
+ <?php foreach($presets as $preset){
547
+ $trim = '['.$module_name.'] ';
548
+ $count = 1;
549
+ ?>
550
+ <li class="list-group-item">
551
+ <span class="delpreset"><span class="label label-danger" data-id="<?php echo $preset->term_id; ?>">&times;</span></span>
552
+ <a href="<?php echo $gmCore->get_admin_url(array('preset' => $preset->term_id), array(), $url); ?>"><?php echo str_replace($trim, '', $preset->name, $count); ?></a>
553
+ </li>
554
+ <?php } ?>
555
+ </ul>
556
+ <?php } ?>
557
+ </div>
558
+ </script>
559
+ </div>
560
  </div>
561
  <div class="panel-body" id="gmedia-msg-panel"></div>
562
  <div class="panel-body" id="gmedia-edit-gallery" style="margin-bottom:4px; padding-top:0;">
592
  } ?></p>
593
 
594
  <p><b><?php _e('Gallery author:', 'gmLang'); ?></b>
595
+ <?php if($gmCore->caps['gmedia_delete_others_media']){ ?>
596
  <a href="#gallModal" data-modal="filter_authors" data-action="gmedia_get_modal" class="gmedia-modal" title="<?php _e('Click to choose author for gallery', 'gmLang'); ?>"><?php echo $gallery['global']? get_the_author_meta('display_name', $gallery['global']) : __('(no author / shared albums)'); ?></a>
597
  <?php if($author_new){
598
  echo '<br /><span class="text-danger">' . __('Note: Author changed but not saved yet. You can see Albums list only of chosen author') . '</span>';
614
  <label><?php _e('Status', 'gmLang'); ?></label>
615
  <select name="gallery[status]" class="form-control input-sm">
616
  <option value="public"<?php selected($gallery['status'], 'public'); ?>><?php _e('Public', 'gmLang'); ?></option>
617
+ <option value="private"<?php selected($gallery['status'], 'private'); ?>><?php _e('Private', 'gmLang'); ?></option>
618
+ <option value="draft"<?php selected($gallery['status'], 'draft'); ?>><?php _e('Draft', 'gmLang'); ?></option>
 
 
 
619
  </select>
620
  </div>
621
  <div class="form-group">
admin/gmedia.php CHANGED
@@ -748,8 +748,11 @@ function gmediaLib(){
748
  <div class="col-lg-6">
749
  <div class="form-group">
750
  <label><?php _e('Author', 'gmLang'); ?></label>
751
- <?php $user_ids = $gmCore->caps['gmedia_edit_others_media']? $gmCore->get_editable_user_ids() : false;
752
  if($user_ids){
 
 
 
753
  wp_dropdown_users(array(
754
  'include' => $user_ids,
755
  'include_selected' => true,
748
  <div class="col-lg-6">
749
  <div class="form-group">
750
  <label><?php _e('Author', 'gmLang'); ?></label>
751
+ <?php $user_ids = $gmCore->caps['gmedia_delete_others_media']? $gmCore->get_editable_user_ids() : false;
752
  if($user_ids){
753
+ if(!in_array($user_ID, $user_ids)){
754
+ array_push($user_ids, $user_ID);
755
+ }
756
  wp_dropdown_users(array(
757
  'include' => $user_ids,
758
  'include_selected' => true,
admin/import.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- ini_set('display_errors', 0);
4
- ini_set('error_reporting', 0);
5
- ini_set('max_execution_time', 600);
6
  /*
7
  @apache_setenv('no-gzip', 1);
8
  @ini_set('zlib.output_compression', 0);
@@ -11,29 +11,29 @@ for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
11
  ob_implicit_flush(1);
12
  */
13
 
14
- require_once(dirname(dirname(__FILE__)) . '/config.php');
15
 
16
  /** WordPress Image Administration API */
17
- require_once(ABSPATH . 'wp-admin/includes/image.php');
18
 
19
  // HTTP headers for no cache etc
20
  nocache_headers();
21
 
22
- check_admin_referer('GmediaImport');
23
- if(!current_user_can('gmedia_import')){
24
- wp_die(__('You do not have permission to upload files.'));
25
  }
26
 
27
  // 10 minutes execution time
28
- @set_time_limit(10 * 60);
29
 
30
  // fake upload time
31
- usleep(10);
32
 
33
  global $gmCore, $gmGallery;
34
 
35
- $import = $gmCore->_post('import');
36
- $terms = $gmCore->_post('terms', array());
37
 
38
  /**
39
  * @param $files
@@ -41,22 +41,38 @@ $terms = $gmCore->_post('terms', array());
41
  * @param $move
42
  * @param int $exists
43
  */
44
- function gmedia_import_files($files, $terms, $move, $exists = 0){
45
- global $gmCore, $gmGallery;
46
 
47
- if(ob_get_level() == 0){
48
  ob_start();
49
  }
50
  $eol = '</pre>' . PHP_EOL;
51
- $c = count($files);
52
- $i = 0;
53
- foreach($files as $file){
54
-
55
- if(is_array($file)){
56
- if(isset($file['file'])){
57
- extract($file);
58
- } else{
59
- _e('Something went wrong...', 'gmLang');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  die();
61
  }
62
  }
@@ -64,370 +80,410 @@ function gmedia_import_files($files, $terms, $move, $exists = 0){
64
  wp_ob_end_flush_all();
65
  flush();
66
 
67
- $i++;
68
- $prefix = "\n<pre>$i/$c - ";
69
  $prefix_ko = "\n<pre class='ko'>$i/$c - ";
70
 
71
- if(!is_file($file)){
72
- echo $prefix_ko . sprintf(__('File not exists: %s', 'gmLang'), $file) . $eol;
73
  continue;
74
  }
75
 
76
 
77
- $fileinfo = $gmCore->fileinfo($file, $exists);
78
 
79
  // try to make grand-media dir if not exists
80
- if(!wp_mkdir_p($fileinfo['dirpath'])){
81
- echo $prefix_ko . sprintf(__('Unable to create directory `%s`. Is its parent directory writable by the server?', 'gmLang'), $fileinfo['dirpath']) . $eol;
82
  continue;
83
  }
84
  // Check if grand-media dir is writable
85
- if(!is_writable($fileinfo['dirpath'])){
86
- @chmod($fileinfo['dirpath'], 0755);
87
- if(!is_writable($fileinfo['dirpath'])){
88
- echo $prefix_ko . sprintf(__('Directory `%s` or its subfolders are not writable by the server.', 'gmLang'), dirname($fileinfo['dirpath'])) . $eol;
89
  continue;
90
  }
91
  }
92
 
93
- if(!copy($file, $fileinfo['filepath'])){
94
- echo $prefix_ko . sprintf(__("Can't copy file from `%s` to `%s`", 'gmLang'), $file, $fileinfo['filepath']) . $eol;
95
  continue;
96
  }
97
 
98
- $gmCore->file_chmod($fileinfo['filepath']);
99
 
100
- $size = false;
101
  $is_webimage = false;
102
- if('image' == $fileinfo['dirname']){
103
- $size = @getimagesize($fileinfo['filepath']);
104
- if($size && file_is_displayable_image($fileinfo['filepath'])){
105
- if(!wp_mkdir_p($fileinfo['dirpath_thumb'])){
106
- echo $prefix_ko . sprintf(__('Unable to create directory `%s`. Is its parent directory writable by the server?', 'gmLang'), $fileinfo['dirpath_thumb']) . $eol;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  continue;
108
  }
109
- if(!is_writable($fileinfo['dirpath_thumb'])){
110
- @chmod($fileinfo['dirpath_thumb'], 0755);
111
- if(!is_writable($fileinfo['dirpath_thumb'])){
112
- @unlink($fileinfo['filepath']);
113
- echo $prefix_ko . sprintf(__('Directory `%s` is not writable by the server.', 'gmLang'), $fileinfo['dirpath_thumb']) . $eol;
114
  continue;
115
  }
116
  }
117
- if(!wp_mkdir_p($fileinfo['dirpath_original'])){
118
- echo $prefix_ko . sprintf(__('Unable to create directory `%s`. Is its parent directory writable by the server?', 'gmLang'), $fileinfo['dirpath_original']) . $eol;
119
  continue;
120
  }
121
- if(!is_writable($fileinfo['dirpath_original'])){
122
- @chmod($fileinfo['dirpath_original'], 0755);
123
- if(!is_writable($fileinfo['dirpath_original'])){
124
- @unlink($fileinfo['filepath']);
125
- echo $prefix_ko . sprintf(__('Directory `%s` is not writable by the server.', 'gmLang'), $fileinfo['dirpath_original']) . $eol;
126
  continue;
127
  }
128
  }
129
 
130
  // Optimized image
131
- $webimg = $gmGallery->options['image'];
132
  $thumbimg = $gmGallery->options['thumb'];
133
 
134
- $webimg['resize'] = (($webimg['width'] < $size[0]) || ($webimg['height'] < $size[1]))? true : false;
135
- $thumbimg['resize'] = (($thumbimg['width'] < $size[0]) || ($thumbimg['height'] < $size[1]))? true : false;
136
 
137
- if($webimg['resize']){
138
- rename($fileinfo['filepath'], $fileinfo['filepath_original']);
139
- } else{
140
- copy($fileinfo['filepath'], $fileinfo['filepath_original']);
141
  }
142
- if($webimg['resize'] || $thumbimg['resize']){
143
- $editor = wp_get_image_editor($fileinfo['filepath_original']);
144
- if(is_wp_error($editor)){
145
- @unlink($fileinfo['filepath_original']);
146
  echo $prefix_ko . $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message() . $eol;
147
  continue;
148
  }
149
 
150
- if($webimg['resize']){
151
- $editor->set_quality($webimg['quality']);
152
 
153
- $resized = $editor->resize($webimg['width'], $webimg['height'], $webimg['crop']);
154
- if(is_wp_error($resized)){
155
- @unlink($fileinfo['filepath_original']);
156
  echo $prefix_ko . $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message() . $eol;
157
  continue;
158
  }
159
 
160
- $saved = $editor->save($fileinfo['filepath']);
161
- if(is_wp_error($saved)){
162
- @unlink($fileinfo['filepath_original']);
163
  echo $prefix_ko . $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message() . $eol;
164
  continue;
165
  }
166
  }
167
 
168
  // Thumbnail
169
- $editor->set_quality($thumbimg['quality']);
170
 
171
- $resized = $editor->resize($thumbimg['width'], $thumbimg['height'], $thumbimg['crop']);
172
- if(is_wp_error($resized)){
173
- @unlink($fileinfo['filepath']);
174
- @unlink($fileinfo['filepath_original']);
175
  echo $prefix_ko . $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})): " . $resized->get_error_message() . $eol;
176
  continue;
177
  }
178
 
179
- $saved = $editor->save($fileinfo['filepath_thumb']);
180
- if(is_wp_error($saved)){
181
- @unlink($fileinfo['filepath']);
182
- @unlink($fileinfo['filepath_original']);
183
  echo $prefix_ko . $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->thumb): " . $saved->get_error_message() . $eol;
184
  continue;
185
  }
186
- } else{
187
- copy($fileinfo['filepath'], $fileinfo['filepath_thumb']);
188
  }
189
  $is_webimage = true;
190
- } else{
191
- @unlink($fileinfo['filepath']);
192
- echo $prefix_ko . $fileinfo['basename'] . ": " . __("Could not read image size. Invalid image was deleted.", 'gmLang') . $eol;
193
  continue;
194
  }
195
  }
196
 
197
- global $gmDB;
198
-
199
  // Write media data to DB
200
  // TODO Option to set title empty string or from metadata or from filename or both
201
  // use image exif/iptc data for title and caption defaults if possible
202
- if($size && !isset($title) && !isset($description)){
203
- $image_meta = @wp_read_image_metadata($fileinfo['filepath_original']);
204
- if(trim($image_meta['title']) && !is_numeric(sanitize_title($image_meta['title']))){
205
  $title = $image_meta['title'];
206
  }
207
- if(trim($image_meta['caption'])){
208
  $description = $image_meta['caption'];
209
  }
210
  }
211
- if(!isset($title) || empty($title)){
212
  $title = $fileinfo['title'];
213
  }
214
- if(!isset($description)){
215
  $description = '';
216
  }
217
- if(!isset($link)){
218
  $link = '';
219
  }
220
 
221
- $_terms = $terms;
222
-
223
- $gmedia_album = isset($_terms['gmedia_album'])? $_terms['gmedia_album'] : false;
224
- if($gmedia_album && $this->is_digit($gmedia_album)){
225
- $album = $gmDB->get_term($gmedia_album, 'gmedia_album');
226
- if(empty($album) || is_wp_error($album)){
227
- $status = 'public';
228
- } else{
229
- $status = $album->status;
230
- }
231
- } else{
232
- $status = 'public';
233
- }
234
-
235
- if(!$is_webimage){
236
- unset($_terms['gmedia_category']);
237
  }
238
 
239
  // Construct the media_data array
240
  $media_data = array(
241
- 'mime_type' => $fileinfo['mime_type'],
242
- 'gmuid' => $fileinfo['basename'],
243
- 'title' => $title,
244
- 'link' => $link,
245
  'description' => $description,
246
- 'status' => $status,
247
- 'terms' => $_terms
248
  );
 
 
 
249
 
250
- unset($title, $description);
251
 
252
  // Save the data
253
- $id = $gmDB->insert_gmedia($media_data);
254
- $gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_metadata', $gmDB->generate_gmedia_metadata($id, $fileinfo));
255
 
256
- echo $prefix . $fileinfo['basename'] . ': <span class="ok">' . sprintf(__('success (ID #%s)', 'gmLang'), $id) . '</span>' . $eol;
257
 
258
- if($move){
259
- @unlink($file);
260
  }
261
 
262
  }
263
 
264
- echo '<p><b>' . __('Category') . ':</b> ' . ((isset($terms['gmedia_category']) && !empty($terms['gmedia_category']))? esc_html($gmGallery->options['taxonomies']['gmedia_category'][$terms['gmedia_category']]) : '-') . PHP_EOL;
265
- echo '<br /><b>' . __('Album') . ':</b> ' . ((isset($terms['gmedia_album']) && !empty($terms['gmedia_album']))? esc_html($terms['gmedia_album']) : '-') . PHP_EOL;
266
- echo '<br /><b>' . __('Tags') . ':</b> ' . ((isset($terms['gmedia_tag']) && !empty($terms['gmedia_tag']))? esc_html(str_replace(',', ', ', $terms['gmedia_tag'])) : '-') . '</p>' . PHP_EOL;
267
 
268
  wp_ob_end_flush_all();
269
  flush();
270
  }
271
 
272
- if(ob_get_level() == 0){
273
  ob_start();
274
  }
275
- echo str_pad(' ', 4096) . PHP_EOL;
276
  wp_ob_end_flush_all();
277
  flush();
278
  ?>
279
  <html>
280
  <style type="text/css">
281
- * { margin:0; padding:0; }
282
- pre { display:block; }
283
- p { padding:10px 0; font-size:14px; }
284
- .ok { color:darkgreen; }
285
- .ko { color:darkred; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  </style>
287
  <body>
288
  <?php
289
- if('import-folder' == $import){
290
 
291
- $path = $gmCore->_post('path');
292
- echo '<h4 style="margin: 0 0 10px">' . __('Import Server Folder') . " `$path`:</h4>" . PHP_EOL;
293
 
294
- if($path){
295
- $path = trim(urldecode($path), '/');
296
- if(!empty($path)){
297
- $fullpath = ABSPATH . trailingslashit($path);
298
- $files = glob($fullpath . '?*.?*', GLOB_NOSORT);
299
- if(!empty($files)){
300
  $allowed_ext = get_allowed_mime_types();
301
- $allowed_ext = array_keys($allowed_ext);
302
- $allowed_ext = implode('|', $allowed_ext);
303
- $allowed_ext = explode('|', $allowed_ext);
304
- if((GMEDIA_UPLOAD_FOLDER == basename(dirname(dirname($path)))) || (GMEDIA_UPLOAD_FOLDER == basename(dirname($path)))){
305
  global $wpdb;
306
- $gmedias = $wpdb->get_col("SELECT gmuid FROM {$wpdb->prefix}gmedia");
307
- foreach($files as $i => $filepath){
308
- $gmuid = basename($filepath);
309
- if(in_array($gmuid, $gmedias)){
310
- $fileinfo = $gmCore->fileinfo($gmuid, false);
311
- if(!(('image' == $fileinfo['dirname']) && !file_exists($fileinfo['filepath']))){
312
- unset($files[$i]);
313
  }
314
  }
315
  }
316
- $move = false;
317
  $exists = false;
318
- } else{
319
- $move = $gmCore->_post('delete_source');
320
  $exists = 0;
321
  }
322
- foreach($files as $i => $filepath){
323
- $ext = pathinfo($filepath, PATHINFO_EXTENSION);
324
- if(!in_array($ext, $allowed_ext)){
325
- unset($files[$i]);
326
  }
327
  }
328
- gmedia_import_files($files, $terms, $move, $exists);
329
- } else{
330
- echo sprintf(__('Folder `%s` is empty', 'gmLang'), $path) . PHP_EOL;
331
  }
332
- } else{
333
- echo __('No folder chosen', 'gmLang') . PHP_EOL;
334
  }
335
  }
336
- } elseif('import-flagallery' == $import){
337
 
338
- echo '<h4 style="margin: 0 0 10px">' . __('Import from Flagallery plugin') . ":</h4>" . PHP_EOL;
339
 
340
- $gallery = $gmCore->_post('gallery');
341
- if(!empty($gallery)){
342
  global $wpdb, $gmDB;
343
 
344
- $album = (!isset($terms['gmedia_album']) || empty($terms['gmedia_album']))? false : true;
345
- foreach($gallery as $gid){
346
- $flag_gallery = $wpdb->get_row($wpdb->prepare("SELECT gid, path, title, galdesc FROM `{$wpdb->prefix}flag_gallery` WHERE gid = %d", $gid), ARRAY_A);
347
- if(empty($flag_gallery)){
348
  continue;
349
  }
350
 
351
- if(!$album){
352
  $terms['gmedia_album'] = $flag_gallery['title'];
353
- if(!$gmDB->term_exists($flag_gallery['title'], 'gmedia_album')){
354
- $term_id = $gmDB->insert_term($flag_gallery['title'], 'gmedia_album', array('description' => htmlspecialchars_decode(stripslashes($flag_gallery['galdesc']))));
355
  }
356
  }
357
 
358
- $path = ABSPATH . trailingslashit($flag_gallery['path']);
359
 
360
- echo '<h5 style="margin: 10px 0 5px">' . sprintf(__('Import `%s` gallery', 'gmLang'), $flag_gallery['title']) . ":</h5>" . PHP_EOL;
361
 
362
- $flag_pictures = $wpdb->get_results($wpdb->prepare("SELECT CONCAT('%s', filename) AS file, description, alttext AS title, link FROM `{$wpdb->prefix}flag_pictures` WHERE galleryid = %d", $path, $flag_gallery['gid']), ARRAY_A);
363
- if(empty($flag_pictures)){
364
- echo '<pre>' . __('gallery contains 0 images', 'gmLang') . '</pre>';
365
  continue;
366
  }
367
  //echo '<pre>'.print_r($flag_pictures, true).'</pre>';
368
- gmedia_import_files($flag_pictures, $terms, false);
369
  }
370
- } else{
371
- echo __('No gallery chosen', 'gmLang') . PHP_EOL;
372
  }
373
- } elseif('import-nextgen' == $import){
374
 
375
- echo '<h4 style="margin: 0 0 10px">' . __('Import from NextGen plugin') . ":</h4>" . PHP_EOL;
376
 
377
- $gallery = $gmCore->_post('gallery');
378
- if(!empty($gallery)){
379
  global $wpdb, $gmDB;
380
 
381
- $album = (!isset($terms['gmedia_album']) || empty($terms['gmedia_album']))? false : true;
382
- foreach($gallery as $gid){
383
- $ngg_gallery = $wpdb->get_row($wpdb->prepare("SELECT gid, path, title, galdesc FROM `{$wpdb->prefix}ngg_gallery` WHERE gid = %d", $gid), ARRAY_A);
384
- if(empty($ngg_gallery)){
385
  continue;
386
  }
387
 
388
- if(!$album){
389
  $terms['gmedia_album'] = $ngg_gallery['title'];
390
- if(!$gmDB->term_exists($ngg_gallery['title'], 'gmedia_album')){
391
- $term_id = $gmDB->insert_term($ngg_gallery['title'], 'gmedia_album', array('description' => htmlspecialchars_decode(stripslashes($ngg_gallery['galdesc']))));
392
  }
393
  }
394
 
395
- $path = ABSPATH . trailingslashit($ngg_gallery['path']);
396
 
397
- echo '<h5 style="margin: 10px 0 5px">' . sprintf(__('Import `%s` gallery', 'gmLang'), $ngg_gallery['title']) . ":</h5>" . PHP_EOL;
398
 
399
- $ngg_pictures = $wpdb->get_results($wpdb->prepare("SELECT CONCAT('%s', filename) AS file, description, alttext AS title FROM `{$wpdb->prefix}ngg_pictures` WHERE galleryid = %d", $path, $ngg_gallery['gid']), ARRAY_A);
400
- if(empty($ngg_pictures)){
401
- echo '<pre>' . __('gallery contains 0 images', 'gmLang') . '</pre>';
402
  continue;
403
  }
404
- gmedia_import_files($ngg_pictures, $terms, false);
405
  }
406
- } else{
407
- echo __('No gallery chosen', 'gmLang') . PHP_EOL;
408
  }
409
- } elseif('import-wpmedia' == $import){
410
  global $user_ID, $gmDB;
411
 
412
- echo '<h4 style="margin: 0 0 10px">' . __('Import from WP Media Library') . ":</h4>" . PHP_EOL;
413
 
414
- $wpMediaLib = $gmDB->get_wp_media_lib(array('filter' => 'selected', 'selected' => $gmCore->_post('selected')));
415
 
416
- if(!empty($wpMediaLib)){
417
 
418
  $wp_media = array();
419
- foreach($wpMediaLib as $item){
420
  $wp_media[] = array(
421
- 'file' => get_attached_file($item->ID),
422
- 'title' => $item->post_title,
423
  'description' => $item->post_content
424
  );
425
  }
426
  //echo '<pre>' . print_r($wp_media, true) . '</pre>';
427
- gmedia_import_files($wp_media, $terms, false);
428
 
429
- } else{
430
- echo __('No items chosen', 'gmLang') . PHP_EOL;
431
  }
432
  }
433
  ?>
1
  <?php
2
 
3
+ ini_set( 'display_errors', 0 );
4
+ ini_set( 'error_reporting', 0 );
5
+ ini_set( 'max_execution_time', 600 );
6
  /*
7
  @apache_setenv('no-gzip', 1);
8
  @ini_set('zlib.output_compression', 0);
11
  ob_implicit_flush(1);
12
  */
13
 
14
+ require_once( dirname( dirname( __FILE__ ) ) . '/config.php' );
15
 
16
  /** WordPress Image Administration API */
17
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
18
 
19
  // HTTP headers for no cache etc
20
  nocache_headers();
21
 
22
+ check_admin_referer( 'GmediaImport' );
23
+ if ( ! current_user_can( 'gmedia_import' ) ) {
24
+ wp_die( __( 'You do not have permission to upload files.' ) );
25
  }
26
 
27
  // 10 minutes execution time
28
+ @set_time_limit( 10 * 60 );
29
 
30
  // fake upload time
31
+ usleep( 10 );
32
 
33
  global $gmCore, $gmGallery;
34
 
35
+ $import = $gmCore->_post( 'import' );
36
+ $terms = $gmCore->_post( 'terms', array() );
37
 
38
  /**
39
  * @param $files
41
  * @param $move
42
  * @param int $exists
43
  */
44
+ function gmedia_import_files( $files, $terms, $move, $exists = 0 ) {
45
+ global $gmCore, $gmGallery, $gmDB;
46
 
47
+ if ( ob_get_level() == 0 ) {
48
  ob_start();
49
  }
50
  $eol = '</pre>' . PHP_EOL;
51
+
52
+ $_terms = $terms;
53
+
54
+ $gmedia_album = isset( $_terms['gmedia_album'] ) ? $_terms['gmedia_album'] : false;
55
+ if ( $gmedia_album && $gmCore->is_digit( $gmedia_album ) ) {
56
+ $album = $gmDB->get_term( $gmedia_album, 'gmedia_album' );
57
+ if ( empty( $album ) || is_wp_error( $album ) ) {
58
+ $status = 'public';
59
+ } else {
60
+ $status = $album->status;
61
+ $album_name = $album->name;
62
+ }
63
+ } else {
64
+ $status = 'public';
65
+ }
66
+
67
+ $c = count( $files );
68
+ $i = 0;
69
+ foreach ( $files as $file ) {
70
+
71
+ if ( is_array( $file ) ) {
72
+ if ( isset( $file['file'] ) ) {
73
+ extract( $file );
74
+ } else {
75
+ _e( 'Something went wrong...', 'gmLang' );
76
  die();
77
  }
78
  }
80
  wp_ob_end_flush_all();
81
  flush();
82
 
83
+ $i ++;
84
+ $prefix = "\n<pre>$i/$c - ";
85
  $prefix_ko = "\n<pre class='ko'>$i/$c - ";
86
 
87
+ if ( ! is_file( $file ) ) {
88
+ echo $prefix_ko . sprintf( __( 'File not exists: %s', 'gmLang' ), $file ) . $eol;
89
  continue;
90
  }
91
 
92
 
93
+ $fileinfo = $gmCore->fileinfo( $file, $exists );
94
 
95
  // try to make grand-media dir if not exists
96
+ if ( ! wp_mkdir_p( $fileinfo['dirpath'] ) ) {
97
+ echo $prefix_ko . sprintf( __( 'Unable to create directory `%s`. Is its parent directory writable by the server?', 'gmLang' ), $fileinfo['dirpath'] ) . $eol;
98
  continue;
99
  }
100
  // Check if grand-media dir is writable
101
+ if ( ! is_writable( $fileinfo['dirpath'] ) ) {
102
+ @chmod( $fileinfo['dirpath'], 0755 );
103
+ if ( ! is_writable( $fileinfo['dirpath'] ) ) {
104
+ echo $prefix_ko . sprintf( __( 'Directory `%s` or its subfolders are not writable by the server.', 'gmLang' ), dirname( $fileinfo['dirpath'] ) ) . $eol;
105
  continue;
106
  }
107
  }
108
 
109
+ if ( ! copy( $file, $fileinfo['filepath'] ) ) {
110
+ echo $prefix_ko . sprintf( __( "Can't copy file from `%s` to `%s`", 'gmLang' ), $file, $fileinfo['filepath'] ) . $eol;
111
  continue;
112
  }
113
 
114
+ $gmCore->file_chmod( $fileinfo['filepath'] );
115
 
116
+ $size = false;
117
  $is_webimage = false;
118
+ if ( 'image' == $fileinfo['dirname'] ) {
119
+ $size = @getimagesize( $fileinfo['filepath'] );
120
+ if ( $size && file_is_displayable_image( $fileinfo['filepath'] ) ) {
121
+ if ( function_exists( 'memory_get_usage' ) ) {
122
+ $extensions = array( '1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP' );
123
+ switch ( $extensions[ $size[2] ] ) {
124
+ case 'GIF':
125
+ $CHANNEL = 1;
126
+ break;
127
+ case 'JPG':
128
+ $CHANNEL = $size['channels'];
129
+ break;
130
+ case 'PNG':
131
+ $CHANNEL = 3;
132
+ break;
133
+ case 'BMP':
134
+ default:
135
+ $CHANNEL = 6;
136
+ break;
137
+ }
138
+ $MB = 1048576; // number of bytes in 1M
139
+ $K64 = 65536; // number of bytes in 64K
140
+ $TWEAKFACTOR = 1.8; // Or whatever works for you
141
+ $memoryNeeded = round( ( $size[0] * $size[1] * $size['bits'] * $CHANNEL / 8 + $K64 ) * $TWEAKFACTOR );
142
+ $memoryNeeded = memory_get_usage() + $memoryNeeded;
143
+ $current_limit = @ini_get( 'memory_limit' );
144
+ $current_limit_int = intval( $current_limit );
145
+ if ( false !== strpos( $current_limit, 'M' ) ) {
146
+ $current_limit_int *= $MB;
147
+ }
148
+ if ( false !== strpos( $current_limit, 'G' ) ) {
149
+ $current_limit_int *= 1024;
150
+ }
151
+
152
+ if ( - 1 != $current_limit && $memoryNeeded > $current_limit_int ) {
153
+ $newLimit = $current_limit_int / $MB + ceil( ( $memoryNeeded - $current_limit_int ) / $MB );
154
+ @ini_set( 'memory_limit', $newLimit . 'M' );
155
+ }
156
+ }
157
+
158
+ if ( ! wp_mkdir_p( $fileinfo['dirpath_thumb'] ) ) {
159
+ echo $prefix_ko . sprintf( __( 'Unable to create directory `%s`. Is its parent directory writable by the server?', 'gmLang' ), $fileinfo['dirpath_thumb'] ) . $eol;
160
  continue;
161
  }
162
+ if ( ! is_writable( $fileinfo['dirpath_thumb'] ) ) {
163
+ @chmod( $fileinfo['dirpath_thumb'], 0755 );
164
+ if ( ! is_writable( $fileinfo['dirpath_thumb'] ) ) {
165
+ @unlink( $fileinfo['filepath'] );
166
+ echo $prefix_ko . sprintf( __( 'Directory `%s` is not writable by the server.', 'gmLang' ), $fileinfo['dirpath_thumb'] ) . $eol;
167
  continue;
168
  }
169
  }
170
+ if ( ! wp_mkdir_p( $fileinfo['dirpath_original'] ) ) {
171
+ echo $prefix_ko . sprintf( __( 'Unable to create directory `%s`. Is its parent directory writable by the server?', 'gmLang' ), $fileinfo['dirpath_original'] ) . $eol;
172
  continue;
173
  }
174
+ if ( ! is_writable( $fileinfo['dirpath_original'] ) ) {
175
+ @chmod( $fileinfo['dirpath_original'], 0755 );
176
+ if ( ! is_writable( $fileinfo['dirpath_original'] ) ) {
177
+ @unlink( $fileinfo['filepath'] );
178
+ echo $prefix_ko . sprintf( __( 'Directory `%s` is not writable by the server.', 'gmLang' ), $fileinfo['dirpath_original'] ) . $eol;
179
  continue;
180
  }
181
  }
182
 
183
  // Optimized image
184
+ $webimg = $gmGallery->options['image'];
185
  $thumbimg = $gmGallery->options['thumb'];
186
 
187
+ $webimg['resize'] = ( ( $webimg['width'] < $size[0] ) || ( $webimg['height'] < $size[1] ) ) ? true : false;
188
+ $thumbimg['resize'] = ( ( $thumbimg['width'] < $size[0] ) || ( $thumbimg['height'] < $size[1] ) ) ? true : false;
189
 
190
+ if ( $webimg['resize'] ) {
191
+ rename( $fileinfo['filepath'], $fileinfo['filepath_original'] );
192
+ } else {
193
+ copy( $fileinfo['filepath'], $fileinfo['filepath_original'] );
194
  }
195
+ if ( $webimg['resize'] || $thumbimg['resize'] ) {
196
+ $editor = wp_get_image_editor( $fileinfo['filepath_original'] );
197
+ if ( is_wp_error( $editor ) ) {
198
+ @unlink( $fileinfo['filepath_original'] );
199
  echo $prefix_ko . $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message() . $eol;
200
  continue;
201
  }
202
 
203
+ if ( $webimg['resize'] ) {
204
+ $editor->set_quality( $webimg['quality'] );
205
 
206
+ $resized = $editor->resize( $webimg['width'], $webimg['height'], $webimg['crop'] );
207
+ if ( is_wp_error( $resized ) ) {
208
+ @unlink( $fileinfo['filepath_original'] );
209
  echo $prefix_ko . $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message() . $eol;
210
  continue;
211
  }
212
 
213
+ $saved = $editor->save( $fileinfo['filepath'] );
214
+ if ( is_wp_error( $saved ) ) {
215
+ @unlink( $fileinfo['filepath_original'] );
216
  echo $prefix_ko . $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message() . $eol;
217
  continue;
218
  }
219
  }
220
 
221
  // Thumbnail
222
+ $editor->set_quality( $thumbimg['quality'] );
223
 
224
+ $resized = $editor->resize( $thumbimg['width'], $thumbimg['height'], $thumbimg['crop'] );
225
+ if ( is_wp_error( $resized ) ) {
226
+ @unlink( $fileinfo['filepath'] );
227
+ @unlink( $fileinfo['filepath_original'] );
228
  echo $prefix_ko . $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})): " . $resized->get_error_message() . $eol;
229
  continue;
230
  }
231
 
232
+ $saved = $editor->save( $fileinfo['filepath_thumb'] );
233
+ if ( is_wp_error( $saved ) ) {
234
+ @unlink( $fileinfo['filepath'] );
235
+ @unlink( $fileinfo['filepath_original'] );
236
  echo $prefix_ko . $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->thumb): " . $saved->get_error_message() . $eol;
237
  continue;
238
  }
239
+ } else {
240
+ copy( $fileinfo['filepath'], $fileinfo['filepath_thumb'] );
241
  }
242
  $is_webimage = true;
243
+ } else {
244
+ @unlink( $fileinfo['filepath'] );
245
+ echo $prefix_ko . $fileinfo['basename'] . ": " . __( "Could not read image size. Invalid image was deleted.", 'gmLang' ) . $eol;
246
  continue;
247
  }
248
  }
249
 
 
 
250
  // Write media data to DB
251
  // TODO Option to set title empty string or from metadata or from filename or both
252
  // use image exif/iptc data for title and caption defaults if possible
253
+ if ( $size && ! isset( $title ) && ! isset( $description ) ) {
254
+ $image_meta = @wp_read_image_metadata( $fileinfo['filepath_original'] );
255
+ if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
256
  $title = $image_meta['title'];
257
  }
258
+ if ( trim( $image_meta['caption'] ) ) {
259
  $description = $image_meta['caption'];
260
  }
261
  }
262
+ if ( ! isset( $title ) || empty( $title ) ) {
263
  $title = $fileinfo['title'];
264
  }
265
+ if ( ! isset( $description ) ) {
266
  $description = '';
267
  }
268
+ if ( ! isset( $link ) ) {
269
  $link = '';
270
  }
271
 
272
+ if ( ! $is_webimage ) {
273
+ unset( $_terms['gmedia_category'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  }
275
 
276
  // Construct the media_data array
277
  $media_data = array(
278
+ 'mime_type' => $fileinfo['mime_type'],
279
+ 'gmuid' => $fileinfo['basename'],
280
+ 'title' => $title,
281
+ 'link' => $link,
282
  'description' => $description,
283
+ 'status' => $status,
284
+ 'terms' => $_terms
285
  );
286
+ if ( ! current_user_can( 'gmedia_delete_others_media' ) ) {
287
+ $media_data['author'] = get_current_user_id();
288
+ }
289
 
290
+ unset( $title, $description );
291
 
292
  // Save the data
293
+ $id = $gmDB->insert_gmedia( $media_data );
294
+ $gmDB->update_metadata( $meta_type = 'gmedia', $id, $meta_key = '_metadata', $gmDB->generate_gmedia_metadata( $id, $fileinfo ) );
295
 
296
+ echo $prefix . $fileinfo['basename'] . ': <span class="ok">' . sprintf( __( 'success (ID #%s)', 'gmLang' ), $id ) . '</span>' . $eol;
297
 
298
+ if ( $move ) {
299
+ @unlink( $file );
300
  }
301
 
302
  }
303
 
304
+ echo '<p><b>' . __( 'Category' ) . ':</b> ' . ( ( isset( $terms['gmedia_category'] ) && ! empty( $terms['gmedia_category'] ) ) ? esc_html( $gmGallery->options['taxonomies']['gmedia_category'][ $terms['gmedia_category'] ] ) : '-' ) . PHP_EOL;
305
+ echo '<br /><b>' . __( 'Album' ) . ':</b> ' . ( ( isset( $terms['gmedia_album'] ) && ! empty( $terms['gmedia_album'] ) ) ? ( isset($album_name)? $album_name : esc_html( $terms['gmedia_album'] ) ) : '-' ) . PHP_EOL;
306
+ echo '<br /><b>' . __( 'Tags' ) . ':</b> ' . ( ( isset( $terms['gmedia_tag'] ) && ! empty( $terms['gmedia_tag'] ) ) ? esc_html( str_replace( ',', ', ', $terms['gmedia_tag'] ) ) : '-' ) . '</p>' . PHP_EOL;
307
 
308
  wp_ob_end_flush_all();
309
  flush();
310
  }
311
 
312
+ if ( ob_get_level() == 0 ) {
313
  ob_start();
314
  }
315
+ echo str_pad( ' ', 4096 ) . PHP_EOL;
316
  wp_ob_end_flush_all();
317
  flush();
318
  ?>
319
  <html>
320
  <style type="text/css">
321
+ * {
322
+ margin: 0;
323
+ padding: 0;
324
+ }
325
+
326
+ pre {
327
+ display: block;
328
+ }
329
+
330
+ p {
331
+ padding: 10px 0;
332
+ font-size: 14px;
333
+ }
334
+
335
+ .ok {
336
+ color: darkgreen;
337
+ }
338
+
339
+ .ko {
340
+ color: darkred;
341
+ }
342
  </style>
343
  <body>
344
  <?php
345
+ if ( 'import-folder' == $import ) {
346
 
347
+ $path = $gmCore->_post( 'path' );
348
+ echo '<h4 style="margin: 0 0 10px">' . __( 'Import Server Folder' ) . " `$path`:</h4>" . PHP_EOL;
349
 
350
+ if ( $path ) {
351
+ $path = trim( urldecode( $path ), '/' );
352
+ if ( ! empty( $path ) ) {
353
+ $fullpath = ABSPATH . trailingslashit( $path );
354
+ $files = glob( $fullpath . '?*.?*', GLOB_NOSORT );
355
+ if ( ! empty( $files ) ) {
356
  $allowed_ext = get_allowed_mime_types();
357
+ $allowed_ext = array_keys( $allowed_ext );
358
+ $allowed_ext = implode( '|', $allowed_ext );
359
+ $allowed_ext = explode( '|', $allowed_ext );
360
+ if ( ( GMEDIA_UPLOAD_FOLDER == basename( dirname( dirname( $path ) ) ) ) || ( GMEDIA_UPLOAD_FOLDER == basename( dirname( $path ) ) ) ) {
361
  global $wpdb;
362
+ $gmedias = $wpdb->get_col( "SELECT gmuid FROM {$wpdb->prefix}gmedia" );
363
+ foreach ( $files as $i => $filepath ) {
364
+ $gmuid = basename( $filepath );
365
+ if ( in_array( $gmuid, $gmedias ) ) {
366
+ $fileinfo = $gmCore->fileinfo( $gmuid, false );
367
+ if ( ! ( ( 'image' == $fileinfo['dirname'] ) && ! file_exists( $fileinfo['filepath'] ) ) ) {
368
+ unset( $files[ $i ] );
369
  }
370
  }
371
  }
372
+ $move = false;
373
  $exists = false;
374
+ } else {
375
+ $move = $gmCore->_post( 'delete_source' );
376
  $exists = 0;
377
  }
378
+ foreach ( $files as $i => $filepath ) {
379
+ $ext = pathinfo( $filepath, PATHINFO_EXTENSION );
380
+ if ( ! in_array( strtolower($ext), $allowed_ext ) ) {
381
+ unset( $files[ $i ] );
382
  }
383
  }
384
+ gmedia_import_files( $files, $terms, $move, $exists );
385
+ } else {
386
+ echo sprintf( __( 'Folder `%s` is empty', 'gmLang' ), $path ) . PHP_EOL;
387
  }
388
+ } else {
389
+ echo __( 'No folder chosen', 'gmLang' ) . PHP_EOL;
390
  }
391
  }
392
+ } elseif ( 'import-flagallery' == $import ) {
393
 
394
+ echo '<h4 style="margin: 0 0 10px">' . __( 'Import from Flagallery plugin' ) . ":</h4>" . PHP_EOL;
395
 
396
+ $gallery = $gmCore->_post( 'gallery' );
397
+ if ( ! empty( $gallery ) ) {
398
  global $wpdb, $gmDB;
399
 
400
+ $album = ( ! isset( $terms['gmedia_album'] ) || empty( $terms['gmedia_album'] ) ) ? false : true;
401
+ foreach ( $gallery as $gid ) {
402
+ $flag_gallery = $wpdb->get_row( $wpdb->prepare( "SELECT gid, path, title, galdesc FROM `{$wpdb->prefix}flag_gallery` WHERE gid = %d", $gid ), ARRAY_A );
403
+ if ( empty( $flag_gallery ) ) {
404
  continue;
405
  }
406
 
407
+ if ( ! $album ) {
408
  $terms['gmedia_album'] = $flag_gallery['title'];
409
+ if ( ! $gmDB->term_exists( $flag_gallery['title'], 'gmedia_album' ) ) {
410
+ $term_id = $gmDB->insert_term( $flag_gallery['title'], 'gmedia_album', array( 'description' => htmlspecialchars_decode( stripslashes( $flag_gallery['galdesc'] ) ) ) );
411
  }
412
  }
413
 
414
+ $path = ABSPATH . trailingslashit( $flag_gallery['path'] );
415
 
416
+ echo '<h5 style="margin: 10px 0 5px">' . sprintf( __( 'Import `%s` gallery', 'gmLang' ), $flag_gallery['title'] ) . ":</h5>" . PHP_EOL;
417
 
418
+ $flag_pictures = $wpdb->get_results( $wpdb->prepare( "SELECT CONCAT('%s', filename) AS file, description, alttext AS title, link FROM `{$wpdb->prefix}flag_pictures` WHERE galleryid = %d", $path, $flag_gallery['gid'] ), ARRAY_A );
419
+ if ( empty( $flag_pictures ) ) {
420
+ echo '<pre>' . __( 'gallery contains 0 images', 'gmLang' ) . '</pre>';
421
  continue;
422
  }
423
  //echo '<pre>'.print_r($flag_pictures, true).'</pre>';
424
+ gmedia_import_files( $flag_pictures, $terms, false );
425
  }
426
+ } else {
427
+ echo __( 'No gallery chosen', 'gmLang' ) . PHP_EOL;
428
  }
429
+ } elseif ( 'import-nextgen' == $import ) {
430
 
431
+ echo '<h4 style="margin: 0 0 10px">' . __( 'Import from NextGen plugin' ) . ":</h4>" . PHP_EOL;
432
 
433
+ $gallery = $gmCore->_post( 'gallery' );
434
+ if ( ! empty( $gallery ) ) {
435
  global $wpdb, $gmDB;
436
 
437
+ $album = ( ! isset( $terms['gmedia_album'] ) || empty( $terms['gmedia_album'] ) ) ? false : true;
438
+ foreach ( $gallery as $gid ) {
439
+ $ngg_gallery = $wpdb->get_row( $wpdb->prepare( "SELECT gid, path, title, galdesc FROM `{$wpdb->prefix}ngg_gallery` WHERE gid = %d", $gid ), ARRAY_A );
440
+ if ( empty( $ngg_gallery ) ) {
441
  continue;
442
  }
443
 
444
+ if ( ! $album ) {
445
  $terms['gmedia_album'] = $ngg_gallery['title'];
446
+ if ( ! $gmDB->term_exists( $ngg_gallery['title'], 'gmedia_album' ) ) {
447
+ $term_id = $gmDB->insert_term( $ngg_gallery['title'], 'gmedia_album', array( 'description' => htmlspecialchars_decode( stripslashes( $ngg_gallery['galdesc'] ) ) ) );
448
  }
449
  }
450
 
451
+ $path = ABSPATH . trailingslashit( $ngg_gallery['path'] );
452
 
453
+ echo '<h5 style="margin: 10px 0 5px">' . sprintf( __( 'Import `%s` gallery', 'gmLang' ), $ngg_gallery['title'] ) . ":</h5>" . PHP_EOL;
454
 
455
+ $ngg_pictures = $wpdb->get_results( $wpdb->prepare( "SELECT CONCAT('%s', filename) AS file, description, alttext AS title FROM `{$wpdb->prefix}ngg_pictures` WHERE galleryid = %d", $path, $ngg_gallery['gid'] ), ARRAY_A );
456
+ if ( empty( $ngg_pictures ) ) {
457
+ echo '<pre>' . __( 'gallery contains 0 images', 'gmLang' ) . '</pre>';
458
  continue;
459
  }
460
+ gmedia_import_files( $ngg_pictures, $terms, false );
461
  }
462
+ } else {
463
+ echo __( 'No gallery chosen', 'gmLang' ) . PHP_EOL;
464
  }
465
+ } elseif ( 'import-wpmedia' == $import ) {
466
  global $user_ID, $gmDB;
467
 
468
+ echo '<h4 style="margin: 0 0 10px">' . __( 'Import from WP Media Library' ) . ":</h4>" . PHP_EOL;
469
 
470
+ $wpMediaLib = $gmDB->get_wp_media_lib( array( 'filter' => 'selected', 'selected' => $gmCore->_post( 'selected' ) ) );
471
 
472
+ if ( ! empty( $wpMediaLib ) ) {
473
 
474
  $wp_media = array();
475
+ foreach ( $wpMediaLib as $item ) {
476
  $wp_media[] = array(
477
+ 'file' => get_attached_file( $item->ID ),
478
+ 'title' => $item->post_title,
479
  'description' => $item->post_content
480
  );
481
  }
482
  //echo '<pre>' . print_r($wp_media, true) . '</pre>';
483
+ gmedia_import_files( $wp_media, $terms, false );
484
 
485
+ } else {
486
+ echo __( 'No items chosen', 'gmLang' ) . PHP_EOL;
487
  }
488
  }
489
  ?>
admin/js/grand-media.js CHANGED
@@ -298,7 +298,8 @@ jQuery(function($){
298
  }).on('shown.bs.modal',function(){
299
  $('#import_form').submit();
300
  }).on('hidden.bs.modal', function(){
301
- $('#import-done').button('reset').prop('disabled', true);
 
302
  $('#import_window').attr('src', 'about:blank');
303
  });
304
  });
@@ -307,7 +308,8 @@ jQuery(function($){
307
  e.preventDefault();
308
  $('body').addClass('gmedia-busy');
309
  var module = $(this).data('module');
310
- $('.module_install').filter('[data-module="' + module + '"]').button('loading');
 
311
  var post_data = {
312
  action: 'gmedia_module_install', download: $(this).attr('href'), module: module, _wpnonce: $('#_wpnonce').val()
313
  };
@@ -318,7 +320,73 @@ jQuery(function($){
318
  });
319
  });
320
 
321
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  };
323
 
324
  GmediaSelect.init();
298
  }).on('shown.bs.modal',function(){
299
  $('#import_form').submit();
300
  }).on('hidden.bs.modal', function(){
301
+ var btn = $('#import-done');
302
+ btn.text(btn.data('reset-text')).prop('disabled', true);
303
  $('#import_window').attr('src', 'about:blank');
304
  });
305
  });
308
  e.preventDefault();
309
  $('body').addClass('gmedia-busy');
310
  var module = $(this).data('module');
311
+ var btn = $('.module_install').filter('[data-module="' + module + '"]');
312
+ btn.text(btn.data('loading-text'));
313
  var post_data = {
314
  action: 'gmedia_module_install', download: $(this).attr('href'), module: module, _wpnonce: $('#_wpnonce').val()
315
  };
320
  });
321
  });
322
 
323
+ $('form').on('keydown', 'input[type="text"]', function (e) {
324
+ if (e.keyCode == 13) {
325
+ var inputs = $(this).parents("form").eq(0).find(":input");
326
+ if (inputs[inputs.index(this) + 1] !== null) {
327
+ inputs[inputs.index(this) + 1].focus();
328
+ }
329
+ e.preventDefault();
330
+ return false;
331
+ }
332
+ });
333
+
334
+ var preset_popover = function(){
335
+ $('#save_preset').popover({
336
+ container: '#module_preset',
337
+ content: function(){
338
+ return $('#_save_preset').html();
339
+ },
340
+ html: true,
341
+ placement: 'bottom'
342
+ }).on('show.bs.popover', function () {
343
+ $(this).addClass('active');
344
+ }).on('hide.bs.popover', function () {
345
+ $(this).removeClass('active');
346
+ });
347
+ };
348
+ preset_popover();
349
+ $('#gallerySettingsForm').on('click', '.ajax-submit', function(e){
350
+ e.preventDefault();
351
+ $('body').addClass('gmedia-busy');
352
+ var form = $('#gallerySettingsForm');
353
+ var post_data = form.serializeArray();
354
+ post_data.push({name: $(this).attr('name'), value: 1});
355
+ var post_url = form.attr('action');
356
+ $.post(post_url, $.param(post_data), function(data, status, xhr){
357
+ $('body').removeClass('gmedia-busy');
358
+ data = $(data).find('#gmedia-container');
359
+ $('#gm-message').append($('#gm-message', data).html());
360
+ $('#save_buttons').html($('#save_buttons', data).html());
361
+ $('#module_preset').html($('#module_preset', data).html());
362
+ preset_popover();
363
+ });
364
+ });
365
+ $('body').on('click', function (e) {
366
+ if ($(e.target).data('toggle') !== 'popover'
367
+ && $(e.target).parents('.popover.in').length === 0) {
368
+ $('[data-toggle="popover"]').popover('hide');
369
+ }
370
+ });
371
+
372
+ $('#module_preset').on('click', '.delpreset span', function(){
373
+ $('body').addClass('gmedia-busy');
374
+ var preset_item_li = $(this).closest('li');
375
+ var preset_id = $(this).data('id');
376
+ var post_data = {
377
+ action: 'gmedia_module_preset_delete', preset_id: preset_id, _wpnonce: $('#_wpnonce').val()
378
+ };
379
+ $.post(ajaxurl, post_data, function(data, status, xhr){
380
+ if(data.error){
381
+ $('#gm-message').append(data.error);
382
+ } else {
383
+ preset_item_li.remove();
384
+ }
385
+ $('body').removeClass('gmedia-busy');
386
+ });
387
+ });
388
+
389
+ }
390
  };
391
 
392
  GmediaSelect.init();
admin/js/meta-box.js CHANGED
@@ -1,6 +1,8 @@
1
  var gmActiveEditor = false;
2
  (function($, window, document, undefined){
3
- $('body').on('click', 'textarea.wp-editor-area', function(){
 
 
4
  gmActiveEditor = $(this).attr('id');
5
  setTimeout(function(){
6
  gm_check_scode(gmActiveEditor);
@@ -84,6 +86,43 @@ var gmActiveEditor = false;
84
  }
85
  });
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  })(jQuery, window, document, undefined);
88
 
89
  function gm_check_scode(id){
1
  var gmActiveEditor = false;
2
  (function($, window, document, undefined){
3
+
4
+ /*
5
+ $('body').on('click', 'textarea.wp-editor-area', function(){
6
  gmActiveEditor = $(this).attr('id');
7
  setTimeout(function(){
8
  gm_check_scode(gmActiveEditor);
86
  }
87
  });
88
 
89
+ */
90
+
91
+ $(document).on( 'click', '#gmedia-modal', function( event ) {
92
+ event.stopPropagation();
93
+ event.preventDefault();
94
+
95
+ var modal = $('#__gm-uploader');
96
+
97
+ if(modal.length) {
98
+ modal.css('display','block');
99
+ } else{
100
+ var title = $(this).attr('title');
101
+ modal = $($('#tpl__gm-uploader').html());
102
+ modal.find('.media-modal-close, .media-modal-backdrop').on('click', function(){
103
+ modal.css('display', 'none');
104
+ });
105
+ modal.find('.media-menu-item').on('click', function(){
106
+ $('iframe', modal).attr('src', '');
107
+ $(this).addClass('active').siblings('a').removeClass('active');
108
+ $('.media-frame-title h1', modal).text($(this).text());
109
+ });
110
+ $("body").append(modal);
111
+ }
112
+ });
113
+
114
+ $('#postimagediv').on('click', '#set-gmedia-post-thumbnail', function(){
115
+ $('#wp-content-media-buttons').find('#gmedia-modal').trigger('click');
116
+ var modal = $('#__gm-uploader');
117
+ var library = modal.find('#gmedia-modal-library');
118
+ if(!library.hasClass('active')){
119
+ var ifr = modal.find('iframe').clone();
120
+ ifr.attr('src', library.attr('href'));
121
+ library.trigger('click');
122
+ modal.find('iframe').replaceWith(ifr);
123
+ }
124
+ });
125
+
126
  })(jQuery, window, document, undefined);
127
 
128
  function gm_check_scode(id){
admin/modules.php CHANGED
@@ -60,7 +60,7 @@ function gmediaModules(){
60
  <div id="gmedia_modules">
61
  <div class="panel panel-default">
62
  <div class="panel-heading clearfix">
63
- <a href="#installModuleModal" class="btn btn-primary pull-right<?php if(!$gmCore->caps['gmedia_module_manage']){
64
  echo ' disabled';
65
  } ?>" data-toggle="modal"><?php _e('Install Module ZIP'); ?></a>
66
 
60
  <div id="gmedia_modules">
61
  <div class="panel panel-default">
62
  <div class="panel-heading clearfix">
63
+ <a href="#installModuleModal" class="btn btn-primary pull-right<?php if(!current_user_can('manage_options')){
64
  echo ' disabled';
65
  } ?>" data-toggle="modal"><?php _e('Install Module ZIP'); ?></a>
66
 
admin/processor.php CHANGED
@@ -85,6 +85,8 @@ class GmediaProcessor{
85
  return;
86
  }
87
 
 
 
88
  switch($this->page){
89
  case 'GrandMedia':
90
  if(!$gmCore->caps['gmedia_library']){
@@ -361,7 +363,14 @@ class GmediaProcessor{
361
  case 'custom':
362
  $description_custom = $gmCore->_post('batch_description_custom');
363
  if(false !== $description_custom){
364
- $batch_data['description'] = $description_custom;
 
 
 
 
 
 
 
365
  }
366
  break;
367
  }
@@ -527,6 +536,11 @@ class GmediaProcessor{
527
  }
528
  }
529
  if($edit_term){
 
 
 
 
 
530
  $term_id = $gmDB->update_term($edit_term, $term['taxonomy'], $term);
531
  } else{
532
  $term_id = $gmDB->insert_term($term['name'], $term['taxonomy'], $term);
@@ -678,6 +692,12 @@ class GmediaProcessor{
678
  }
679
  }
680
 
 
 
 
 
 
 
681
  if(isset($_POST['gmedia_gallery_reset'])){
682
  check_admin_referer('GmediaGallery');
683
  $edit_gallery = (int)$gmCore->_get('edit_gallery');
@@ -703,6 +723,11 @@ class GmediaProcessor{
703
  */
704
  if(file_exists($module_path['path'] . '/settings.php')){
705
  include($module_path['path'] . '/settings.php');
 
 
 
 
 
706
  } else{
707
  $this->error[] = sprintf(__('Can\'t load data from `%s` module'), $gallery_module);
708
  break;
@@ -721,6 +746,58 @@ class GmediaProcessor{
721
 
722
  }
723
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
724
  if(!empty($this->selected_items)){
725
  if('selected' == $gmCore->_get('delete')){
726
  check_admin_referer('gmedia_delete');
@@ -759,13 +836,28 @@ class GmediaProcessor{
759
  if(!$gmCore->caps['gmedia_gallery_manage']){
760
  wp_die(__('You are not allowed to manage gmedia galleries', 'gmLang'));
761
  }
 
 
 
762
  if(isset($_FILES['modulezip']['tmp_name'])){
763
  if(!empty($_FILES['modulezip']['tmp_name'])){
764
  check_admin_referer('GmediaModule');
765
- if(!$gmCore->caps['gmedia_module_manage']){
766
- wp_die(__('You are not allowed to manage gmedia modules', 'gmLang'));
767
  }
768
  $to_folder = $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/';
 
 
 
 
 
 
 
 
 
 
 
 
769
  $filename = wp_unique_filename($to_folder, $_FILES['modulezip']['name']);
770
 
771
  // Move the file to the modules dir
@@ -822,7 +914,52 @@ class GmediaProcessor{
822
 
823
  $capabilities = $gmCore->_post('capability', array());
824
  if(!empty($capabilities) && current_user_can('manage_options')){
825
- foreach($capabilities as $key => $val){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
  $gmDB->set_capability($val, $key);
827
  }
828
  }
85
  return;
86
  }
87
 
88
+ auth_redirect();
89
+
90
  switch($this->page){
91
  case 'GrandMedia':
92
  if(!$gmCore->caps['gmedia_library']){
363
  case 'custom':
364
  $description_custom = $gmCore->_post('batch_description_custom');
365
  if(false !== $description_custom){
366
+ $what_description_custom = $gmCore->_post('what_description_custom');
367
+ if('replace' == $what_description_custom) {
368
+ $batch_data['description'] = $description_custom;
369
+ } elseif('append' == $what_description_custom){
370
+ $batch_data['description'] = $gmedia['description'] . $description_custom;
371
+ } elseif('prepend' == $what_description_custom){
372
+ $batch_data['description'] = $description_custom . $gmedia['description'];
373
+ }
374
  }
375
  break;
376
  }
536
  }
537
  }
538
  if($edit_term){
539
+ $_term = $gmDB->get_term($edit_term, $taxonomy);
540
+ if(((int)$_term->global != (int)$user_ID) && !current_user_can('gmedia_edit_others_media')){
541
+ $this->error[] = __('You are not allowed to edit others media', 'gmLang');
542
+ break;
543
+ }
544
  $term_id = $gmDB->update_term($edit_term, $term['taxonomy'], $term);
545
  } else{
546
  $term_id = $gmDB->insert_term($term['name'], $term['taxonomy'], $term);
692
  }
693
  }
694
 
695
+ if(isset($_POST['module_preset_restore_original'])){
696
+ $preset_id = intval( $gmCore->_post( 'preset_default', 0 ) );
697
+ $gmDB->delete_term( $preset_id, 'gmedia_module' );
698
+ $this->msg[] = __('Original module settings restored. Click "Reset to default" button to save original module settings for gallery', 'gmLang');
699
+ }
700
+
701
  if(isset($_POST['gmedia_gallery_reset'])){
702
  check_admin_referer('GmediaGallery');
703
  $edit_gallery = (int)$gmCore->_get('edit_gallery');
723
  */
724
  if(file_exists($module_path['path'] . '/settings.php')){
725
  include($module_path['path'] . '/settings.php');
726
+ $preset = $gmDB->get_term('['.$gallery_module.']', 'gmedia_module');
727
+ if($preset){
728
+ $default_preset = maybe_unserialize($preset->description);
729
+ $default_options = $gmCore->array_replace_recursive($default_options, $default_preset);
730
+ }
731
  } else{
732
  $this->error[] = sprintf(__('Can\'t load data from `%s` module'), $gallery_module);
733
  break;
746
 
747
  }
748
 
749
+ if(isset($_POST['module_preset_save_as']) || isset($_POST['module_preset_save_default'])){
750
+ check_admin_referer('GmediaGallery');
751
+ do{
752
+ $gallery = $gmCore->_post('gallery');
753
+ if(empty($gallery['module'])){
754
+ $this->error[] = __('Something goes wrong... Choose module, please', 'gmLang');
755
+ break;
756
+ }
757
+ $module_settings = $gmCore->_post('module', array());
758
+ $module_path = $gmCore->get_module_path($gallery['module']);
759
+ $default_options = array();
760
+ if(file_exists($module_path['path'] . '/settings.php')){
761
+ include($module_path['path'] . '/settings.php');
762
+ } else{
763
+ $this->error[] = sprintf(__('Can\'t load data from `%s` module'), $gallery['module']);
764
+ break;
765
+ }
766
+ $module_settings = $gmCore->array_replace_recursive($default_options, $module_settings);
767
+
768
+ $preset_name = $gmCore->_post('module_preset_name', '');
769
+ if(isset($_POST['module_preset_save_default'])){
770
+ $preset_name = '['.$gallery['module'].']';
771
+ } else {
772
+ $preset_name = trim( $preset_name );
773
+ if(empty($preset_name)){
774
+ $this->error[] = __('Preset name is not specified', 'gmLang');
775
+ break;
776
+ }
777
+ $preset_name = '['.$gallery['module'].'] '.$preset_name;
778
+ }
779
+ $args = array();
780
+ $args['description'] = $module_settings;
781
+ $args['status'] = $gallery['module'];
782
+ $args['global'] = $user_ID;
783
+
784
+ $taxonomy = 'gmedia_module';
785
+ $term_id = $gmDB->term_exists($preset_name, $taxonomy, $user_ID);
786
+ if($term_id){
787
+ $term_id = $gmDB->update_term( $term_id, $taxonomy, $args );
788
+ } else {
789
+ $term_id = $gmDB->insert_term( $preset_name, $taxonomy, $args );
790
+ }
791
+ if(is_wp_error($term_id)){
792
+ $this->error[] = $term_id->get_error_message();
793
+ break;
794
+ } else{
795
+ $this->msg[] = sprintf(__('Preset `%s` successfuly saved', 'gmLang'), $preset_name);
796
+ }
797
+
798
+ } while(0);
799
+ }
800
+
801
  if(!empty($this->selected_items)){
802
  if('selected' == $gmCore->_get('delete')){
803
  check_admin_referer('gmedia_delete');
836
  if(!$gmCore->caps['gmedia_gallery_manage']){
837
  wp_die(__('You are not allowed to manage gmedia galleries', 'gmLang'));
838
  }
839
+ if(!$gmCore->caps['gmedia_module_manage']){
840
+ wp_die(__('You are not allowed to manage gmedia modules', 'gmLang'));
841
+ }
842
  if(isset($_FILES['modulezip']['tmp_name'])){
843
  if(!empty($_FILES['modulezip']['tmp_name'])){
844
  check_admin_referer('GmediaModule');
845
+ if(!current_user_can('manage_options')){
846
+ wp_die(__('You are not allowed to install module ZIP', 'gmLang'));
847
  }
848
  $to_folder = $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/';
849
+ if ( ! wp_mkdir_p( $to_folder ) ) {
850
+ $this->error[] = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang' ), $to_folder );
851
+ break;
852
+ }
853
+ if ( ! is_writable( $to_folder ) ) {
854
+ @chmod( $to_folder, 0755 );
855
+ if ( ! is_writable( $to_folder ) ) {
856
+ //@unlink( $_FILES['modulezip']['tmp_name'] );
857
+ $this->error[] = sprintf( __( 'Directory %s is not writable by the server.', 'gmLang' ), $to_folder );
858
+ break;
859
+ }
860
+ }
861
  $filename = wp_unique_filename($to_folder, $_FILES['modulezip']['name']);
862
 
863
  // Move the file to the modules dir
914
 
915
  $capabilities = $gmCore->_post('capability', array());
916
  if(!empty($capabilities) && current_user_can('manage_options')){
917
+ global $wp_roles;
918
+ $_roles = $wp_roles->roles;
919
+ $_roles = array_keys(apply_filters( 'editable_roles', $_roles ));
920
+ $roles = array_flip($_roles);
921
+
922
+ // upload cap.
923
+ if($roles[$capabilities['gmedia_upload']] < $roles[$capabilities['gmedia_import']]){
924
+ $capabilities['gmedia_import'] = $capabilities['gmedia_upload'];
925
+ }
926
+ // edit/delete cap.
927
+ if($roles[$capabilities['gmedia_edit_media']] < $roles[$capabilities['gmedia_edit_others_media']]){
928
+ $capabilities['gmedia_edit_others_media'] = $capabilities['gmedia_edit_media'];
929
+ }
930
+ if($roles[$capabilities['gmedia_edit_media']] < $roles[$capabilities['gmedia_delete_media']]){
931
+ $capabilities['gmedia_delete_media'] = $capabilities['gmedia_edit_media'];
932
+ }
933
+ if($roles[$capabilities['gmedia_delete_media']] < $roles[$capabilities['gmedia_delete_others_media']]){
934
+ $capabilities['gmedia_delete_others_media'] = $capabilities['gmedia_delete_media'];
935
+ }
936
+ if($roles[$capabilities['gmedia_edit_others_media']] < $roles[$capabilities['gmedia_delete_others_media']]){
937
+ $capabilities['gmedia_delete_others_media'] = $capabilities['gmedia_edit_others_media'];
938
+ }
939
+ if($roles[$capabilities['gmedia_show_others_media']] < $roles[$capabilities['gmedia_edit_others_media']]){
940
+ $capabilities['gmedia_edit_others_media'] = $capabilities['gmedia_show_others_media'];
941
+ }
942
+ if($roles[$capabilities['gmedia_show_others_media']] < $roles[$capabilities['gmedia_delete_others_media']]){
943
+ $capabilities['gmedia_delete_others_media'] = $capabilities['gmedia_show_others_media'];
944
+ }
945
+ // terms cap.
946
+ if($roles[$capabilities['gmedia_terms']] < $roles[$capabilities['gmedia_album_manage']]){
947
+ $capabilities['gmedia_album_manage'] = $capabilities['gmedia_terms'];
948
+ }
949
+ if($roles[$capabilities['gmedia_terms']] < $roles[$capabilities['gmedia_tag_manage']]){
950
+ $capabilities['gmedia_tag_manage'] = $capabilities['gmedia_terms'];
951
+ }
952
+ if($roles[$capabilities['gmedia_terms']] < $roles[$capabilities['gmedia_terms_delete']]){
953
+ $capabilities['gmedia_terms_delete'] = $capabilities['gmedia_terms'];
954
+ } else{
955
+ $rolekey = max($roles[$capabilities['gmedia_album_manage']], $roles[$capabilities['gmedia_tag_manage']]);
956
+ $role = $_roles[$rolekey];
957
+ if($role < $roles[$capabilities['gmedia_terms_delete']]){
958
+ $capabilities['gmedia_terms_delete'] = $role;
959
+ }
960
+ }
961
+
962
+ foreach($capabilities as $key => $val){
963
  $gmDB->set_capability($val, $key);
964
  }
965
  }
admin/settings.php CHANGED
@@ -11,19 +11,19 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
11
  function gmSettings(){
12
  global $gmDB, $gmCore, $gmGallery;
13
 
14
- ?>
15
 
16
  <form class="panel panel-default" method="post">
17
  <div class="panel-heading clearfix">
18
  <div class="btn-toolbar pull-left">
19
  <div class="btn-group">
20
- <button type="submit" name="gmedia_settings_reset" class="btn btn-default" data-confirm="<?php _e('Reset all Gmedia settings?') ?>"><?php _e('Reset Settings', 'gmLang'); ?></button>
21
  <button type="submit" name="gmedia_settings_save" class="btn btn-primary"><?php _e('Update', 'gmLang'); ?></button>
22
- <?php
23
- wp_nonce_field('GmediaSettings');
24
- ?>
25
  </div>
26
  </div>
 
 
 
27
  </div>
28
  <div class="panel-body" id="gmedia-msg-panel"></div>
29
  <div class="container-fluid">
@@ -67,53 +67,55 @@ function gmSettings(){
67
  </div>
68
  <hr/>
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  <div class="form-group">
71
  <label><?php _e('Edit Media', 'gmLang') ?>:</label>
72
  <select name="capability[gmedia_edit_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_edit_media')); ?></select>
73
 
74
  <p class="help-block"><?php _e('Who can edit media title, description and other properties of uploaded files', 'gmLang'); ?></p>
75
  </div>
 
 
 
 
 
 
 
 
76
  <div class="form-group">
77
  <label><?php _e('Delete Media', 'gmLang') ?>:</label>
78
  <select name="capability[gmedia_delete_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_delete_media')); ?></select>
79
 
80
  <p class="help-block"><?php _e('Who can delete uploaded files from Gmedia Library', 'gmLang'); ?></p>
81
  </div>
82
- <div class="form-group">
83
- <label><?php _e('Show Others Media', 'gmLang') ?>:</label>
84
- <select name="capability[gmedia_show_others_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_show_others_media')); ?></select>
85
-
86
- <p class="help-block"><?php _e('Who can see files uploaded by other users', 'gmLang'); ?></p>
87
- </div>
88
- <div class="col-xs-offset-1">
89
- <div class="form-group">
90
- <label><?php _e('Edit Others Media', 'gmLang') ?>:</label>
91
- <select name="capability[gmedia_edit_others_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_edit_others_media')); ?></select>
92
-
93
- <p class="help-block"><?php _e('Who can edit files, albums/tags and galleries of other users', 'gmLang'); ?></p>
94
- </div>
95
- <div class="form-group">
96
- <label><?php _e('Delete Others Media', 'gmLang') ?>:</label>
97
- <select name="capability[gmedia_delete_others_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_delete_others_media')); ?></select>
98
-
99
- <p class="help-block"><?php _e('Who can delete files, albums/tags and galleries of other users', 'gmLang'); ?></p>
100
- </div>
101
- </div>
102
 
103
- <div class="form-group">
104
- <label><?php _e('Upload Media Files', 'gmLang') ?>:</label>
105
- <select name="capability[gmedia_upload]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_upload')); ?></select>
106
-
107
- <p class="help-block"><?php _e('Who can upload files to Gmedia Library', 'gmLang'); ?></p>
108
- </div>
109
- <div class="col-xs-offset-1">
110
- <div class="form-group">
111
- <label><?php _e('Import Media Files', 'gmLang') ?>:</label>
112
- <select name="capability[gmedia_import]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_import')); ?></select>
113
-
114
- <p class="help-block"><?php _e('Who can import files to Gmedia Library', 'gmLang'); ?></p>
115
- </div>
116
- </div>
117
 
118
  <div class="form-group">
119
  <label><?php _e('Albums, Tags...', 'gmLang') ?>:</label>
@@ -126,19 +128,19 @@ function gmSettings(){
126
  <label><?php _e('Manage Albums', 'gmLang') ?>:</label>
127
  <select name="capability[gmedia_album_manage]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_album_manage')); ?></select>
128
 
129
- <p class="help-block"><?php _e('Who can add and edit own albums', 'gmLang'); ?></p>
130
  </div>
131
  <div class="form-group">
132
  <label><?php _e('Manage Tags', 'gmLang') ?>:</label>
133
  <select name="capability[gmedia_tag_manage]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_tag_manage')); ?></select>
134
 
135
- <p class="help-block"><?php _e('Who can add and edit tags', 'gmLang'); ?></p>
136
  </div>
137
  <div class="form-group">
138
  <label><?php _e('Delete Terms', 'gmLang') ?>:</label>
139
  <select name="capability[gmedia_terms_delete]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_terms_delete')); ?></select>
140
 
141
- <p class="help-block"><?php _e('Who can delete own albums or all terms if allowed "Delete Others Media"', 'gmLang'); ?></p>
142
  </div>
143
  </div>
144
 
@@ -146,7 +148,7 @@ function gmSettings(){
146
  <label><?php _e('Galleries', 'gmLang') ?>:</label>
147
  <select name="capability[gmedia_gallery_manage]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_gallery_manage')); ?></select>
148
 
149
- <p class="help-block"><?php _e('Who can add, edit and delete own galleries', 'gmLang'); ?></p>
150
  </div>
151
 
152
  <div class="form-group">
@@ -175,8 +177,17 @@ function gmSettings(){
175
  </select>
176
  </div>
177
  <div class="form-group">
178
- <label><?php _e('Forbid theme to format Gmedia shortcode\'s content', 'gmLang') ?>:</label>
 
 
 
 
179
 
 
 
 
 
 
180
  <div class="checkbox" style="margin:0;">
181
  <input type="hidden" name="set[shortcode_raw]" value="0"/>
182
  <label><input type="checkbox" name="set[shortcode_raw]" value="1" <?php checked($gmGallery->options['shortcode_raw'], '1'); ?> /> <?php _e('Raw output for Gmedia Shortcode', 'gmLang'); ?>
11
  function gmSettings(){
12
  global $gmDB, $gmCore, $gmGallery;
13
 
14
+ ?>
15
 
16
  <form class="panel panel-default" method="post">
17
  <div class="panel-heading clearfix">
18
  <div class="btn-toolbar pull-left">
19
  <div class="btn-group">
20
+ <button type="submit" name="gmedia_settings_reset" class="btn btn-default" data-confirm="<?php _e('Reset all Gmedia settings?', 'gmLang') ?>"><?php _e('Reset Settings', 'gmLang'); ?></button>
21
  <button type="submit" name="gmedia_settings_save" class="btn btn-primary"><?php _e('Update', 'gmLang'); ?></button>
 
 
 
22
  </div>
23
  </div>
24
+ <?php
25
+ wp_nonce_field('GmediaSettings');
26
+ ?>
27
  </div>
28
  <div class="panel-body" id="gmedia-msg-panel"></div>
29
  <div class="container-fluid">
67
  </div>
68
  <hr/>
69
 
70
+ <div class="form-group">
71
+ <label><?php _e('Upload Media Files', 'gmLang') ?>:</label>
72
+ <select name="capability[gmedia_upload]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_upload')); ?></select>
73
+
74
+ <p class="help-block"><?php _e('Who can upload files to Gmedia Library', 'gmLang'); ?></p>
75
+ </div>
76
+ <div class="col-xs-offset-1">
77
+ <div class="form-group">
78
+ <label><?php _e('Import Media Files', 'gmLang') ?>:</label>
79
+ <select name="capability[gmedia_import]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_import')); ?></select>
80
+
81
+ <p class="help-block"><?php _e('Who can import files to Gmedia Library', 'gmLang'); ?></p>
82
+ </div>
83
+ </div>
84
+
85
+ <div class="form-group">
86
+ <label><?php _e('Show Others Media in Library', 'gmLang') ?>:</label>
87
+ <select name="capability[gmedia_show_others_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_show_others_media')); ?></select>
88
+
89
+ <p class="help-block"><?php _e('Who can see files uploaded by other users', 'gmLang'); ?></p>
90
+ </div>
91
  <div class="form-group">
92
  <label><?php _e('Edit Media', 'gmLang') ?>:</label>
93
  <select name="capability[gmedia_edit_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_edit_media')); ?></select>
94
 
95
  <p class="help-block"><?php _e('Who can edit media title, description and other properties of uploaded files', 'gmLang'); ?></p>
96
  </div>
97
+ <div class="col-xs-offset-1">
98
+ <div class="form-group">
99
+ <label><?php _e('Edit Others Media', 'gmLang') ?>:</label>
100
+ <select name="capability[gmedia_edit_others_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_edit_others_media')); ?></select>
101
+
102
+ <p class="help-block"><?php _e('Who can edit files, albums/tags and galleries of other users', 'gmLang'); ?></p>
103
+ </div>
104
+ </div>
105
  <div class="form-group">
106
  <label><?php _e('Delete Media', 'gmLang') ?>:</label>
107
  <select name="capability[gmedia_delete_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_delete_media')); ?></select>
108
 
109
  <p class="help-block"><?php _e('Who can delete uploaded files from Gmedia Library', 'gmLang'); ?></p>
110
  </div>
111
+ <div class="col-xs-offset-1">
112
+ <div class="form-group">
113
+ <label><?php _e('Delete Others Media', 'gmLang') ?>:</label>
114
+ <select name="capability[gmedia_delete_others_media]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_delete_others_media')); ?></select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
+ <p class="help-block"><?php _e('Who can delete files, albums/tags and galleries of other users', 'gmLang'); ?></p>
117
+ </div>
118
+ </div>
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  <div class="form-group">
121
  <label><?php _e('Albums, Tags...', 'gmLang') ?>:</label>
128
  <label><?php _e('Manage Albums', 'gmLang') ?>:</label>
129
  <select name="capability[gmedia_album_manage]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_album_manage')); ?></select>
130
 
131
+ <p class="help-block"><?php _e('Who can create and edit own albums. It is required "Edit Others Media" capability to edit others and shared albums', 'gmLang'); ?></p>
132
  </div>
133
  <div class="form-group">
134
  <label><?php _e('Manage Tags', 'gmLang') ?>:</label>
135
  <select name="capability[gmedia_tag_manage]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_tag_manage')); ?></select>
136
 
137
+ <p class="help-block"><?php _e('Who can create new tags. It is required "Edit Others Media" capability to edit tags', 'gmLang'); ?></p>
138
  </div>
139
  <div class="form-group">
140
  <label><?php _e('Delete Terms', 'gmLang') ?>:</label>
141
  <select name="capability[gmedia_terms_delete]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_terms_delete')); ?></select>
142
 
143
+ <p class="help-block"><?php _e('Who can delete own albums. It is required "Delete Others Media" capability to delete others terms', 'gmLang'); ?></p>
144
  </div>
145
  </div>
146
 
148
  <label><?php _e('Galleries', 'gmLang') ?>:</label>
149
  <select name="capability[gmedia_gallery_manage]" class="form-control input-sm"><?php wp_dropdown_roles($gmDB->get_role('gmedia_gallery_manage')); ?></select>
150
 
151
+ <p class="help-block"><?php _e('Who can create, edit and delete own galleries', 'gmLang'); ?></p>
152
  </div>
153
 
154
  <div class="form-group">
177
  </select>
178
  </div>
179
  <div class="form-group">
180
+ <label><?php _e('Forbid other plugins to load their JS and CSS on Gmedia admin pages', 'gmLang') ?>:</label>
181
+ <div class="checkbox" style="margin:0;">
182
+ <input type="hidden" name="set[isolation_mode]" value="0"/>
183
+ <label><input type="checkbox" name="set[isolation_mode]" value="1" <?php checked($gmGallery->options['isolation_mode'], '1'); ?> /> <?php _e('Enable Gmedia admin panel Isolation Mode', 'gmLang'); ?>
184
+ </label>
185
 
186
+ <p class="help-block"><?php _e('This option could help to avoid JS and CSS conflicts with other plugins in admin panel.', 'gmLang'); ?></p>
187
+ </div>
188
+ </div>
189
+ <div class="form-group">
190
+ <label><?php _e('Forbid theme to format Gmedia shortcode\'s content', 'gmLang') ?>:</label>
191
  <div class="checkbox" style="margin:0;">
192
  <input type="hidden" name="set[shortcode_raw]" value="0"/>
193
  <label><input type="checkbox" name="set[shortcode_raw]" value="1" <?php checked($gmGallery->options['shortcode_raw'], '1'); ?> /> <?php _e('Raw output for Gmedia Shortcode', 'gmLang'); ?>
admin/terms.php CHANGED
@@ -217,9 +217,11 @@ function gmediaTerms()
217
  <div class="col-xs-6">
218
  <div class="form-group">
219
  <label><?php _e('Author', 'gmLang'); ?></label>
220
- <?php $user_ids = $gmCore->get_editable_user_ids();
221
  if ($user_ids && $gmCore->caps['gmedia_edit_others_media']) {
222
- $shared_option = current_user_can('manage_options') ? __('Shared', 'gmLang') : '';
 
 
223
  wp_dropdown_users(array(
224
  'include' => $user_ids,
225
  'include_selected' => true,
@@ -227,7 +229,7 @@ function gmediaTerms()
227
  'selected' => $user_ID,
228
  'class' => 'form-control input-sm',
229
  'multi' => true,
230
- 'show_option_all' => $shared_option
231
  ));
232
  } else {
233
  echo '<input type="hidden" name="term[global]" value="' . $user_ID . '"/>';
@@ -647,12 +649,9 @@ function gmediaAlbumEdit()
647
  <div class="panel-heading clearfix">
648
  <div class="btn-toolbar pull-left">
649
  <div class="btn-group" style="margin-right:20px;">
650
- <a class="btn btn-primary active"
651
- href="<?php echo add_query_arg(array('term' => 'gmedia_album'), $url); ?>"><?php _e('Albums', 'gmLang'); ?></a>
652
- <a class="btn btn-default"
653
- href="<?php echo add_query_arg(array('term' => 'gmedia_tag'), $url); ?>"><?php _e('Tags', 'gmLang'); ?></a>
654
- <a class="btn btn-default"
655
- href="<?php echo add_query_arg(array('term' => 'gmedia_category'), $url); ?>"><?php _e('Categories', 'gmLang'); ?></a>
656
  </div>
657
 
658
  <div class="btn-group">
@@ -753,9 +752,11 @@ function gmediaAlbumEdit()
753
  <div class="col-xs-6">
754
  <div class="form-group">
755
  <label><?php _e('Author', 'gmLang'); ?></label>
756
- <?php $user_ids = $gmCore->caps['gmedia_edit_others_media'] ? $gmCore->get_editable_user_ids() : false;
757
- if ($user_ids) {
758
- $shared_option = current_user_can('manage_options') ? __('Shared', 'gmLang') : '';
 
 
759
  wp_dropdown_users(array(
760
  'include' => $user_ids,
761
  'include_selected' => true,
@@ -763,7 +764,7 @@ function gmediaAlbumEdit()
763
  'selected' => $term->global,
764
  'class' => 'form-control input-sm',
765
  'multi' => true,
766
- 'show_option_all' => $shared_option
767
  ));
768
  } else {
769
  echo '<input type="hidden" name="term[global]" value="' . $user_ID . '"/>';
217
  <div class="col-xs-6">
218
  <div class="form-group">
219
  <label><?php _e('Author', 'gmLang'); ?></label>
220
+ <?php $user_ids = $gmCore->caps['gmedia_delete_others_media']? $gmCore->get_editable_user_ids() : array($user_ID);
221
  if ($user_ids && $gmCore->caps['gmedia_edit_others_media']) {
222
+ if(!in_array($user_ID, $user_ids)){
223
+ array_push($user_ids, $user_ID);
224
+ }
225
  wp_dropdown_users(array(
226
  'include' => $user_ids,
227
  'include_selected' => true,
229
  'selected' => $user_ID,
230
  'class' => 'form-control input-sm',
231
  'multi' => true,
232
+ 'show_option_all' => __('Shared', 'gmLang')
233
  ));
234
  } else {
235
  echo '<input type="hidden" name="term[global]" value="' . $user_ID . '"/>';
649
  <div class="panel-heading clearfix">
650
  <div class="btn-toolbar pull-left">
651
  <div class="btn-group" style="margin-right:20px;">
652
+ <a class="btn btn-primary active" href="<?php echo add_query_arg(array('term' => 'gmedia_album'), $url); ?>"><?php _e('Albums', 'gmLang'); ?></a>
653
+ <a class="btn btn-default" href="<?php echo add_query_arg(array('term' => 'gmedia_tag'), $url); ?>"><?php _e('Tags', 'gmLang'); ?></a>
654
+ <a class="btn btn-default" href="<?php echo add_query_arg(array('term' => 'gmedia_category'), $url); ?>"><?php _e('Categories', 'gmLang'); ?></a>
 
 
 
655
  </div>
656
 
657
  <div class="btn-group">
752
  <div class="col-xs-6">
753
  <div class="form-group">
754
  <label><?php _e('Author', 'gmLang'); ?></label>
755
+ <?php $user_ids = $gmCore->caps['gmedia_delete_others_media'] ? $gmCore->get_editable_user_ids() : array($user_ID);
756
+ if ($user_ids && $gmCore->caps['gmedia_edit_others_media']) {
757
+ if(!in_array($user_ID, $user_ids)){
758
+ array_push($user_ids, $user_ID);
759
+ }
760
  wp_dropdown_users(array(
761
  'include' => $user_ids,
762
  'include_selected' => true,
764
  'selected' => $term->global,
765
  'class' => 'form-control input-sm',
766
  'multi' => true,
767
+ 'show_option_all' => __('Shared', 'gmLang')
768
  ));
769
  } else {
770
  echo '<input type="hidden" name="term[global]" value="' . $user_ID . '"/>';
admin/upload.php CHANGED
@@ -7,65 +7,69 @@
7
  * Contributing: http://www.plupload.com/contributing
8
  */
9
 
10
- ini_set('display_errors', 0);
11
- ini_set('error_reporting', 0);
12
 
13
- require_once(dirname(dirname(__FILE__)) . '/config.php');
14
 
15
  // HTTP headers for no cache etc
16
  nocache_headers();
17
 
18
- if(!current_user_can('gmedia_upload')){
19
- wp_die(__('You do not have permission to upload files in Gmedia Library.'));
20
  }
21
 
22
- check_admin_referer('grandMedia');
23
 
24
  // 5 minutes execution time
25
- @set_time_limit(5 * 60);
26
 
27
  // fake upload time
28
- usleep(10);
29
 
30
  $return = '';
31
  // Get parameters
32
- if(!isset($_REQUEST["name"])){
33
- $return = json_encode(array("error" => array("code" => 100, "message" => __("No file name.", 'gmLang')), "id" => $_REQUEST["name"]));
34
- die($return);
35
  }
36
 
37
  global $gmCore;
38
  $filename = $_REQUEST["name"];
39
- $fileinfo = $gmCore->fileinfo($filename);
 
 
 
 
40
 
41
  // Look for the content type header
42
  $contentType = '';
43
- if(isset($_SERVER["HTTP_CONTENT_TYPE"])){
44
  $contentType = $_SERVER["HTTP_CONTENT_TYPE"];
45
  }
46
 
47
- if(isset($_SERVER["CONTENT_TYPE"])){
48
  $contentType = $_SERVER["CONTENT_TYPE"];
49
  }
50
 
51
  // Handle non multipart uploads older WebKit versions didn't support multipart in HTML5
52
- if(strpos($contentType, "multipart") !== false){
53
- if(isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])){
54
  $file_tmp = $_FILES['file']['tmp_name'];
55
- } else{
56
- $return = json_encode(array("error" => array("code" => 103, "message" => __("Failed to move uploaded file.", 'gmLang')), "id" => $filename));
57
- die($return);
58
  }
59
- } else{
60
  $file_tmp = "php://input";
61
  }
62
 
63
  $post_data = array();
64
- if(isset($_REQUEST['params'])){
65
- parse_str($_REQUEST['params'], $post_data);
66
  }
67
 
68
- $return = $gmCore->gmedia_upload_handler($file_tmp, $fileinfo, $contentType, $post_data);
69
- $return = json_encode($return);
70
 
71
- die($return);
7
  * Contributing: http://www.plupload.com/contributing
8
  */
9
 
10
+ ini_set( 'display_errors', 0 );
11
+ ini_set( 'error_reporting', 0 );
12
 
13
+ require_once( dirname( dirname( __FILE__ ) ) . '/config.php' );
14
 
15
  // HTTP headers for no cache etc
16
  nocache_headers();
17
 
18
+ if ( ! current_user_can( 'gmedia_upload' ) ) {
19
+ wp_die( __( 'You do not have permission to upload files in Gmedia Library.' ) );
20
  }
21
 
22
+ check_admin_referer( 'grandMedia' );
23
 
24
  // 5 minutes execution time
25
+ @set_time_limit( 5 * 60 );
26
 
27
  // fake upload time
28
+ usleep( 10 );
29
 
30
  $return = '';
31
  // Get parameters
32
+ if ( ! isset( $_REQUEST["name"] ) ) {
33
+ $return = json_encode( array( "error" => array( "code" => 100, "message" => __( "No file name.", 'gmLang' ) ), "id" => $_REQUEST["name"] ) );
34
+ die( $return );
35
  }
36
 
37
  global $gmCore;
38
  $filename = $_REQUEST["name"];
39
+ $fileinfo = $gmCore->fileinfo( $filename );
40
+ if ( false === $fileinfo ) {
41
+ $return = json_encode( array( "error" => array( "code" => 100, "message" => __( "File type not allowed.", 'gmLang' ) ), "id" => $_REQUEST["name"] ) );
42
+ die( $return );
43
+ }
44
 
45
  // Look for the content type header
46
  $contentType = '';
47
+ if ( isset( $_SERVER["HTTP_CONTENT_TYPE"] ) ) {
48
  $contentType = $_SERVER["HTTP_CONTENT_TYPE"];
49
  }
50
 
51
+ if ( isset( $_SERVER["CONTENT_TYPE"] ) ) {
52
  $contentType = $_SERVER["CONTENT_TYPE"];
53
  }
54
 
55
  // Handle non multipart uploads older WebKit versions didn't support multipart in HTML5
56
+ if ( strpos( $contentType, "multipart" ) !== false ) {
57
+ if ( isset( $_FILES['file']['tmp_name'] ) && is_uploaded_file( $_FILES['file']['tmp_name'] ) ) {
58
  $file_tmp = $_FILES['file']['tmp_name'];
59
+ } else {
60
+ $return = json_encode( array( "error" => array( "code" => 103, "message" => __( "Failed to move uploaded file.", 'gmLang' ) ), "id" => $filename ) );
61
+ die( $return );
62
  }
63
+ } else {
64
  $file_tmp = "php://input";
65
  }
66
 
67
  $post_data = array();
68
+ if ( isset( $_REQUEST['params'] ) ) {
69
+ parse_str( $_REQUEST['params'], $post_data );
70
  }
71
 
72
+ $return = $gmCore->gmedia_upload_handler( $file_tmp, $fileinfo, $contentType, $post_data );
73
+ $return = json_encode( $return );
74
 
75
+ die( $return );
admin/wpmedia.php CHANGED
@@ -244,7 +244,8 @@ function grandWPMedia(){
244
  <script type="text/javascript">
245
  function gmedia_import_done(){
246
  if(jQuery('#import_window').is(':visible')){
247
- jQuery('#import-done').button('complete').prop('disabled', false);
 
248
  }
249
  }
250
  </script>
244
  <script type="text/javascript">
245
  function gmedia_import_done(){
246
  if(jQuery('#import_window').is(':visible')){
247
+ var btn = jQuery('#import-done');
248
+ btn.text(btn.data('complete-text')).prop('disabled', false);
249
  }
250
  }
251
  </script>
assets/bootstrap/css/bootstrap-theme.css CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Bootstrap v3.2.0 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
@@ -29,6 +29,14 @@
29
  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
30
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
31
  }
 
 
 
 
 
 
 
 
32
  .btn:active,
33
  .btn.active {
34
  background-image: none;
@@ -61,28 +69,28 @@
61
  background-image: none;
62
  }
63
  .btn-primary {
64
- background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
65
- background-image: -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
66
- background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#2d6ca2));
67
- background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%);
68
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);
69
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
70
  background-repeat: repeat-x;
71
- border-color: #2b669a;
72
  }
73
  .btn-primary:hover,
74
  .btn-primary:focus {
75
- background-color: #2d6ca2;
76
  background-position: 0 -15px;
77
  }
78
  .btn-primary:active,
79
  .btn-primary.active {
80
- background-color: #2d6ca2;
81
- border-color: #2b669a;
82
  }
83
  .btn-primary:disabled,
84
  .btn-primary[disabled] {
85
- background-color: #2d6ca2;
86
  background-image: none;
87
  }
88
  .btn-success {
@@ -203,12 +211,12 @@
203
  .dropdown-menu > .active > a,
204
  .dropdown-menu > .active > a:hover,
205
  .dropdown-menu > .active > a:focus {
206
- background-color: #357ebd;
207
- background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
208
- background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%);
209
- background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd));
210
- background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
211
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
212
  background-repeat: repeat-x;
213
  }
214
  .navbar-default {
@@ -223,12 +231,13 @@
223
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
224
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
225
  }
 
226
  .navbar-default .navbar-nav > .active > a {
227
- background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%);
228
- background-image: -o-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%);
229
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f3f3f3));
230
- background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%);
231
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);
232
  background-repeat: repeat-x;
233
  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
234
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
@@ -246,12 +255,13 @@
246
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
247
  background-repeat: repeat-x;
248
  }
 
249
  .navbar-inverse .navbar-nav > .active > a {
250
- background-image: -webkit-linear-gradient(top, #222 0%, #282828 100%);
251
- background-image: -o-linear-gradient(top, #222 0%, #282828 100%);
252
- background-image: -webkit-gradient(linear, left top, left bottom, from(#222), to(#282828));
253
- background-image: linear-gradient(to bottom, #222 0%, #282828 100%);
254
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);
255
  background-repeat: repeat-x;
256
  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
257
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
@@ -265,6 +275,19 @@
265
  .navbar-fixed-bottom {
266
  border-radius: 0;
267
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  .alert {
269
  text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
270
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
@@ -315,11 +338,11 @@
315
  background-repeat: repeat-x;
316
  }
317
  .progress-bar {
318
- background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%);
319
- background-image: -o-linear-gradient(top, #428bca 0%, #3071a9 100%);
320
- background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3071a9));
321
- background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
322
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
323
  background-repeat: repeat-x;
324
  }
325
  .progress-bar-success {
@@ -367,14 +390,19 @@
367
  .list-group-item.active,
368
  .list-group-item.active:hover,
369
  .list-group-item.active:focus {
370
- text-shadow: 0 -1px 0 #3071a9;
371
- background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%);
372
- background-image: -o-linear-gradient(top, #428bca 0%, #3278b3 100%);
373
- background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3278b3));
374
- background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
375
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
376
  background-repeat: repeat-x;
377
- border-color: #3278b3;
 
 
 
 
 
378
  }
379
  .panel {
380
  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
@@ -389,11 +417,11 @@
389
  background-repeat: repeat-x;
390
  }
391
  .panel-primary > .panel-heading {
392
- background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
393
- background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%);
394
- background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd));
395
- background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
396
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
397
  background-repeat: repeat-x;
398
  }
399
  .panel-success > .panel-heading {
1
  /*!
2
+ * Bootstrap v3.3.1 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
29
  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
30
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
31
  }
32
+ .btn-default .badge,
33
+ .btn-primary .badge,
34
+ .btn-success .badge,
35
+ .btn-info .badge,
36
+ .btn-warning .badge,
37
+ .btn-danger .badge {
38
+ text-shadow: none;
39
+ }
40
  .btn:active,
41
  .btn.active {
42
  background-image: none;
69
  background-image: none;
70
  }
71
  .btn-primary {
72
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
73
+ background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
74
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
75
+ background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
76
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
77
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
78
  background-repeat: repeat-x;
79
+ border-color: #245580;
80
  }
81
  .btn-primary:hover,
82
  .btn-primary:focus {
83
+ background-color: #265a88;
84
  background-position: 0 -15px;
85
  }
86
  .btn-primary:active,
87
  .btn-primary.active {
88
+ background-color: #265a88;
89
+ border-color: #245580;
90
  }
91
  .btn-primary:disabled,
92
  .btn-primary[disabled] {
93
+ background-color: #265a88;
94
  background-image: none;
95
  }
96
  .btn-success {
211
  .dropdown-menu > .active > a,
212
  .dropdown-menu > .active > a:hover,
213
  .dropdown-menu > .active > a:focus {
214
+ background-color: #2e6da4;
215
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
216
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
217
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
218
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
219
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
220
  background-repeat: repeat-x;
221
  }
222
  .navbar-default {
231
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
232
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
233
  }
234
+ .navbar-default .navbar-nav > .open > a,
235
  .navbar-default .navbar-nav > .active > a {
236
+ background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
237
+ background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
238
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
239
+ background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
240
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
241
  background-repeat: repeat-x;
242
  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
243
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
255
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
256
  background-repeat: repeat-x;
257
  }
258
+ .navbar-inverse .navbar-nav > .open > a,
259
  .navbar-inverse .navbar-nav > .active > a {
260
+ background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
261
+ background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
262
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
263
+ background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
264
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
265
  background-repeat: repeat-x;
266
  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
267
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
275
  .navbar-fixed-bottom {
276
  border-radius: 0;
277
  }
278
+ @media (max-width: 767px) {
279
+ .navbar .navbar-nav .open .dropdown-menu > .active > a,
280
+ .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
281
+ .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
282
+ color: #fff;
283
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
284
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
285
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
286
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
287
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
288
+ background-repeat: repeat-x;
289
+ }
290
+ }
291
  .alert {
292
  text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
293
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
338
  background-repeat: repeat-x;
339
  }
340
  .progress-bar {
341
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);
342
+ background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);
343
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090));
344
+ background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);
345
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);
346
  background-repeat: repeat-x;
347
  }
348
  .progress-bar-success {
390
  .list-group-item.active,
391
  .list-group-item.active:hover,
392
  .list-group-item.active:focus {
393
+ text-shadow: 0 -1px 0 #286090;
394
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);
395
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);
396
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a));
397
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);
398
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
399
  background-repeat: repeat-x;
400
+ border-color: #2b669a;
401
+ }
402
+ .list-group-item.active .badge,
403
+ .list-group-item.active:hover .badge,
404
+ .list-group-item.active:focus .badge {
405
+ text-shadow: none;
406
  }
407
  .panel {
408
  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
417
  background-repeat: repeat-x;
418
  }
419
  .panel-primary > .panel-heading {
420
+ background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
421
+ background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
422
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
423
+ background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
424
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
425
  background-repeat: repeat-x;
426
  }
427
  .panel-success > .panel-heading {
assets/bootstrap/css/bootstrap-theme.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Bootstrap v3.2.0 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
- */.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default:disabled,.btn-default[disabled]{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:-o-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#2d6ca2));background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-primary:disabled,.btn-primary[disabled]{background-color:#2d6ca2;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-success:disabled,.btn-success[disabled]{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-info:disabled,.btn-info[disabled]{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-warning:disabled,.btn-warning[disabled]{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-danger:disabled,.btn-danger[disabled]{background-color:#c12e2a;background-image:none}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-o-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#357ebd));background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f3f3f3));background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:-o-linear-gradient(top,#222 0,#282828 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#222),to(#282828));background-image:linear-gradient(to bottom,#222 0,#282828 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:-o-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#3071a9));background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:-o-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#3278b3));background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);background-repeat:repeat-x;border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-o-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#357ebd));background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
1
  /*!
2
+ * Bootstrap v3.3.1 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ */.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-default .badge,.btn-primary .badge,.btn-success .badge,.btn-info .badge,.btn-warning .badge,.btn-danger .badge{text-shadow:none}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default:disabled,.btn-default[disabled]{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:hover,.btn-primary:focus{background-color:#265a88;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#265a88;border-color:#245580}.btn-primary:disabled,.btn-primary[disabled]{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-success:disabled,.btn-success[disabled]{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-info:disabled,.btn-info[disabled]{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-warning:disabled,.btn-warning[disabled]{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-danger:disabled,.btn-danger[disabled]{background-color:#c12e2a;background-image:none}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:hover .badge,.list-group-item.active:focus .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
assets/bootstrap/css/bootstrap.css CHANGED
@@ -1,10 +1,10 @@
1
  /*!
2
- * Bootstrap v3.2.0 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
 
7
- /*! normalize.css v3.0.1 | MIT License | git.io/normalize */
8
  html {
9
  font-family: sans-serif;
10
  -webkit-text-size-adjust: 100%;
@@ -22,6 +22,7 @@ footer,
22
  header,
23
  hgroup,
24
  main,
 
25
  nav,
26
  section,
27
  summary {
@@ -43,7 +44,7 @@ template {
43
  display: none;
44
  }
45
  a {
46
- background: transparent;
47
  }
48
  a:active,
49
  a:hover {
@@ -187,8 +188,11 @@ td,
187
  th {
188
  padding: 0;
189
  }
 
190
  @media print {
191
- * {
 
 
192
  color: #000 !important;
193
  text-shadow: none !important;
194
  background: transparent !important;
@@ -205,8 +209,8 @@ th {
205
  abbr[title]:after {
206
  content: " (" attr(title) ")";
207
  }
208
- a[href^="javascript:"]:after,
209
- a[href^="#"]:after {
210
  content: "";
211
  }
212
  pre,
@@ -241,10 +245,6 @@ th {
241
  .navbar {
242
  display: none;
243
  }
244
- .table td,
245
- .table th {
246
- background-color: #fff !important;
247
- }
248
  .btn > .caret,
249
  .dropup > .btn > .caret {
250
  border-top-color: #000 !important;
@@ -255,6 +255,10 @@ th {
255
  .table {
256
  border-collapse: collapse !important;
257
  }
 
 
 
 
258
  .table-bordered th,
259
  .table-bordered td {
260
  border: 1px solid #ddd !important;
@@ -284,7 +288,8 @@ th {
284
  .glyphicon-plus:before {
285
  content: "\2b";
286
  }
287
- .glyphicon-euro:before {
 
288
  content: "\20ac";
289
  }
290
  .glyphicon-minus:before {
@@ -910,12 +915,12 @@ textarea {
910
  line-height: inherit;
911
  }
912
  a {
913
- color: #428bca;
914
  text-decoration: none;
915
  }
916
  a:hover,
917
  a:focus {
918
- color: #2a6496;
919
  text-decoration: underline;
920
  }
921
  a:focus {
@@ -935,7 +940,6 @@ img {
935
  .carousel-inner > .item > img,
936
  .carousel-inner > .item > a > img {
937
  display: block;
938
- width: 100% \9;
939
  max-width: 100%;
940
  height: auto;
941
  }
@@ -944,7 +948,6 @@ img {
944
  }
945
  .img-thumbnail {
946
  display: inline-block;
947
- width: 100% \9;
948
  max-width: 100%;
949
  height: auto;
950
  padding: 4px;
@@ -1117,9 +1120,6 @@ small,
1117
  .small {
1118
  font-size: 85%;
1119
  }
1120
- cite {
1121
- font-style: normal;
1122
- }
1123
  mark,
1124
  .mark {
1125
  padding: .2em;
@@ -1153,10 +1153,10 @@ mark,
1153
  color: #777;
1154
  }
1155
  .text-primary {
1156
- color: #428bca;
1157
  }
1158
  a.text-primary:hover {
1159
- color: #3071a9;
1160
  }
1161
  .text-success {
1162
  color: #3c763d;
@@ -1184,10 +1184,10 @@ a.text-danger:hover {
1184
  }
1185
  .bg-primary {
1186
  color: #fff;
1187
- background-color: #428bca;
1188
  }
1189
  a.bg-primary:hover {
1190
- background-color: #3071a9;
1191
  }
1192
  .bg-success {
1193
  background-color: #dff0d8;
@@ -1328,10 +1328,6 @@ blockquote.pull-right small:after,
1328
  blockquote.pull-right .small:after {
1329
  content: '\00A0 \2014';
1330
  }
1331
- blockquote:before,
1332
- blockquote:after {
1333
- content: "";
1334
- }
1335
  address {
1336
  margin-bottom: 20px;
1337
  font-style: normal;
@@ -1362,6 +1358,7 @@ kbd {
1362
  kbd kbd {
1363
  padding: 0;
1364
  font-size: 100%;
 
1365
  -webkit-box-shadow: none;
1366
  box-shadow: none;
1367
  }
@@ -2060,6 +2057,12 @@ pre code {
2060
  table {
2061
  background-color: transparent;
2062
  }
 
 
 
 
 
 
2063
  th {
2064
  text-align: left;
2065
  }
@@ -2120,12 +2123,10 @@ th {
2120
  .table-bordered > thead > tr > td {
2121
  border-bottom-width: 2px;
2122
  }
2123
- .table-striped > tbody > tr:nth-child(odd) > td,
2124
- .table-striped > tbody > tr:nth-child(odd) > th {
2125
  background-color: #f9f9f9;
2126
  }
2127
- .table-hover > tbody > tr:hover > td,
2128
- .table-hover > tbody > tr:hover > th {
2129
  background-color: #f5f5f5;
2130
  }
2131
  table col[class*="col-"] {
@@ -2244,13 +2245,15 @@ table th[class*="col-"] {
2244
  .table-hover > tbody > tr.danger:hover > th {
2245
  background-color: #ebcccc;
2246
  }
 
 
 
 
2247
  @media screen and (max-width: 767px) {
2248
  .table-responsive {
2249
  width: 100%;
2250
  margin-bottom: 15px;
2251
- overflow-x: auto;
2252
  overflow-y: hidden;
2253
- -webkit-overflow-scrolling: touch;
2254
  -ms-overflow-style: -ms-autohiding-scrollbar;
2255
  border: 1px solid #ddd;
2256
  }
@@ -2375,14 +2378,14 @@ output {
2375
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
2376
  }
2377
  .form-control::-moz-placeholder {
2378
- color: #777;
2379
  opacity: 1;
2380
  }
2381
  .form-control:-ms-input-placeholder {
2382
- color: #777;
2383
  }
2384
  .form-control::-webkit-input-placeholder {
2385
- color: #777;
2386
  }
2387
  .form-control[disabled],
2388
  .form-control[readonly],
@@ -2397,24 +2400,25 @@ textarea.form-control {
2397
  input[type="search"] {
2398
  -webkit-appearance: none;
2399
  }
2400
- input[type="date"],
2401
- input[type="time"],
2402
- input[type="datetime-local"],
2403
- input[type="month"] {
2404
- line-height: 34px;
2405
- line-height: 1.42857143 \0;
2406
- }
2407
- input[type="date"].input-sm,
2408
- input[type="time"].input-sm,
2409
- input[type="datetime-local"].input-sm,
2410
- input[type="month"].input-sm {
2411
- line-height: 30px;
2412
- }
2413
- input[type="date"].input-lg,
2414
- input[type="time"].input-lg,
2415
- input[type="datetime-local"].input-lg,
2416
- input[type="month"].input-lg {
2417
- line-height: 46px;
 
2418
  }
2419
  .form-group {
2420
  margin-bottom: 15px;
@@ -2423,12 +2427,12 @@ input[type="month"].input-lg {
2423
  .checkbox {
2424
  position: relative;
2425
  display: block;
2426
- min-height: 20px;
2427
  margin-top: 10px;
2428
  margin-bottom: 10px;
2429
  }
2430
  .radio label,
2431
  .checkbox label {
 
2432
  padding-left: 20px;
2433
  margin-bottom: 0;
2434
  font-weight: normal;
@@ -2491,35 +2495,41 @@ fieldset[disabled] .checkbox label {
2491
  padding-left: 0;
2492
  }
2493
  .input-sm,
2494
- .form-horizontal .form-group-sm .form-control {
2495
  height: 30px;
2496
  padding: 5px 10px;
2497
  font-size: 12px;
2498
  line-height: 1.5;
2499
  border-radius: 3px;
2500
  }
2501
- select.input-sm {
 
2502
  height: 30px;
2503
  line-height: 30px;
2504
  }
2505
  textarea.input-sm,
2506
- select[multiple].input-sm {
 
 
2507
  height: auto;
2508
  }
2509
  .input-lg,
2510
- .form-horizontal .form-group-lg .form-control {
2511
  height: 46px;
2512
  padding: 10px 16px;
2513
  font-size: 18px;
2514
  line-height: 1.33;
2515
  border-radius: 6px;
2516
  }
2517
- select.input-lg {
 
2518
  height: 46px;
2519
  line-height: 46px;
2520
  }
2521
  textarea.input-lg,
2522
- select[multiple].input-lg {
 
 
2523
  height: auto;
2524
  }
2525
  .has-feedback {
@@ -2530,7 +2540,7 @@ select[multiple].input-lg {
2530
  }
2531
  .form-control-feedback {
2532
  position: absolute;
2533
- top: 25px;
2534
  right: 0;
2535
  z-index: 2;
2536
  display: block;
@@ -2538,6 +2548,7 @@ select[multiple].input-lg {
2538
  height: 34px;
2539
  line-height: 34px;
2540
  text-align: center;
 
2541
  }
2542
  .input-lg + .form-control-feedback {
2543
  width: 46px;
@@ -2554,7 +2565,11 @@ select[multiple].input-lg {
2554
  .has-success .radio,
2555
  .has-success .checkbox,
2556
  .has-success .radio-inline,
2557
- .has-success .checkbox-inline {
 
 
 
 
2558
  color: #3c763d;
2559
  }
2560
  .has-success .form-control {
@@ -2580,7 +2595,11 @@ select[multiple].input-lg {
2580
  .has-warning .radio,
2581
  .has-warning .checkbox,
2582
  .has-warning .radio-inline,
2583
- .has-warning .checkbox-inline {
 
 
 
 
2584
  color: #8a6d3b;
2585
  }
2586
  .has-warning .form-control {
@@ -2606,7 +2625,11 @@ select[multiple].input-lg {
2606
  .has-error .radio,
2607
  .has-error .checkbox,
2608
  .has-error .radio-inline,
2609
- .has-error .checkbox-inline {
 
 
 
 
2610
  color: #a94442;
2611
  }
2612
  .has-error .form-control {
@@ -2627,6 +2650,9 @@ select[multiple].input-lg {
2627
  .has-error .form-control-feedback {
2628
  color: #a94442;
2629
  }
 
 
 
2630
  .has-feedback label.sr-only ~ .form-control-feedback {
2631
  top: 0;
2632
  }
@@ -2647,6 +2673,9 @@ select[multiple].input-lg {
2647
  width: auto;
2648
  vertical-align: middle;
2649
  }
 
 
 
2650
  .form-inline .input-group {
2651
  display: inline-table;
2652
  vertical-align: middle;
@@ -2707,7 +2736,6 @@ select[multiple].input-lg {
2707
  }
2708
  }
2709
  .form-horizontal .has-feedback .form-control-feedback {
2710
- top: 0;
2711
  right: 15px;
2712
  }
2713
  @media (min-width: 768px) {
@@ -2730,6 +2758,8 @@ select[multiple].input-lg {
2730
  text-align: center;
2731
  white-space: nowrap;
2732
  vertical-align: middle;
 
 
2733
  cursor: pointer;
2734
  -webkit-user-select: none;
2735
  -moz-user-select: none;
@@ -2741,13 +2771,17 @@ select[multiple].input-lg {
2741
  }
2742
  .btn:focus,
2743
  .btn:active:focus,
2744
- .btn.active:focus {
 
 
 
2745
  outline: thin dotted;
2746
  outline: 5px auto -webkit-focus-ring-color;
2747
  outline-offset: -2px;
2748
  }
2749
  .btn:hover,
2750
- .btn:focus {
 
2751
  color: #333;
2752
  text-decoration: none;
2753
  }
@@ -2775,6 +2809,7 @@ fieldset[disabled] .btn {
2775
  }
2776
  .btn-default:hover,
2777
  .btn-default:focus,
 
2778
  .btn-default:active,
2779
  .btn-default.active,
2780
  .open > .dropdown-toggle.btn-default {
@@ -2796,6 +2831,9 @@ fieldset[disabled] .btn-default:hover,
2796
  .btn-default.disabled:focus,
2797
  .btn-default[disabled]:focus,
2798
  fieldset[disabled] .btn-default:focus,
 
 
 
2799
  .btn-default.disabled:active,
2800
  .btn-default[disabled]:active,
2801
  fieldset[disabled] .btn-default:active,
@@ -2811,17 +2849,18 @@ fieldset[disabled] .btn-default.active {
2811
  }
2812
  .btn-primary {
2813
  color: #fff;
2814
- background-color: #428bca;
2815
- border-color: #357ebd;
2816
  }
2817
  .btn-primary:hover,
2818
  .btn-primary:focus,
 
2819
  .btn-primary:active,
2820
  .btn-primary.active,
2821
  .open > .dropdown-toggle.btn-primary {
2822
  color: #fff;
2823
- background-color: #3071a9;
2824
- border-color: #285e8e;
2825
  }
2826
  .btn-primary:active,
2827
  .btn-primary.active,
@@ -2837,17 +2876,20 @@ fieldset[disabled] .btn-primary:hover,
2837
  .btn-primary.disabled:focus,
2838
  .btn-primary[disabled]:focus,
2839
  fieldset[disabled] .btn-primary:focus,
 
 
 
2840
  .btn-primary.disabled:active,
2841
  .btn-primary[disabled]:active,
2842
  fieldset[disabled] .btn-primary:active,
2843
  .btn-primary.disabled.active,
2844
  .btn-primary[disabled].active,
2845
  fieldset[disabled] .btn-primary.active {
2846
- background-color: #428bca;
2847
- border-color: #357ebd;
2848
  }
2849
  .btn-primary .badge {
2850
- color: #428bca;
2851
  background-color: #fff;
2852
  }
2853
  .btn-success {
@@ -2857,6 +2899,7 @@ fieldset[disabled] .btn-primary.active {
2857
  }
2858
  .btn-success:hover,
2859
  .btn-success:focus,
 
2860
  .btn-success:active,
2861
  .btn-success.active,
2862
  .open > .dropdown-toggle.btn-success {
@@ -2878,6 +2921,9 @@ fieldset[disabled] .btn-success:hover,
2878
  .btn-success.disabled:focus,
2879
  .btn-success[disabled]:focus,
2880
  fieldset[disabled] .btn-success:focus,
 
 
 
2881
  .btn-success.disabled:active,
2882
  .btn-success[disabled]:active,
2883
  fieldset[disabled] .btn-success:active,
@@ -2898,6 +2944,7 @@ fieldset[disabled] .btn-success.active {
2898
  }
2899
  .btn-info:hover,
2900
  .btn-info:focus,
 
2901
  .btn-info:active,
2902
  .btn-info.active,
2903
  .open > .dropdown-toggle.btn-info {
@@ -2919,6 +2966,9 @@ fieldset[disabled] .btn-info:hover,
2919
  .btn-info.disabled:focus,
2920
  .btn-info[disabled]:focus,
2921
  fieldset[disabled] .btn-info:focus,
 
 
 
2922
  .btn-info.disabled:active,
2923
  .btn-info[disabled]:active,
2924
  fieldset[disabled] .btn-info:active,
@@ -2939,6 +2989,7 @@ fieldset[disabled] .btn-info.active {
2939
  }
2940
  .btn-warning:hover,
2941
  .btn-warning:focus,
 
2942
  .btn-warning:active,
2943
  .btn-warning.active,
2944
  .open > .dropdown-toggle.btn-warning {
@@ -2960,6 +3011,9 @@ fieldset[disabled] .btn-warning:hover,
2960
  .btn-warning.disabled:focus,
2961
  .btn-warning[disabled]:focus,
2962
  fieldset[disabled] .btn-warning:focus,
 
 
 
2963
  .btn-warning.disabled:active,
2964
  .btn-warning[disabled]:active,
2965
  fieldset[disabled] .btn-warning:active,
@@ -2980,6 +3034,7 @@ fieldset[disabled] .btn-warning.active {
2980
  }
2981
  .btn-danger:hover,
2982
  .btn-danger:focus,
 
2983
  .btn-danger:active,
2984
  .btn-danger.active,
2985
  .open > .dropdown-toggle.btn-danger {
@@ -3001,6 +3056,9 @@ fieldset[disabled] .btn-danger:hover,
3001
  .btn-danger.disabled:focus,
3002
  .btn-danger[disabled]:focus,
3003
  fieldset[disabled] .btn-danger:focus,
 
 
 
3004
  .btn-danger.disabled:active,
3005
  .btn-danger[disabled]:active,
3006
  fieldset[disabled] .btn-danger:active,
@@ -3016,12 +3074,12 @@ fieldset[disabled] .btn-danger.active {
3016
  }
3017
  .btn-link {
3018
  font-weight: normal;
3019
- color: #428bca;
3020
- cursor: pointer;
3021
  border-radius: 0;
3022
  }
3023
  .btn-link,
3024
  .btn-link:active,
 
3025
  .btn-link[disabled],
3026
  fieldset[disabled] .btn-link {
3027
  background-color: transparent;
@@ -3036,7 +3094,7 @@ fieldset[disabled] .btn-link {
3036
  }
3037
  .btn-link:hover,
3038
  .btn-link:focus {
3039
- color: #2a6496;
3040
  text-decoration: underline;
3041
  background-color: transparent;
3042
  }
@@ -3091,9 +3149,11 @@ input[type="button"].btn-block {
3091
  }
3092
  .collapse {
3093
  display: none;
 
3094
  }
3095
  .collapse.in {
3096
  display: block;
 
3097
  }
3098
  tr.collapse.in {
3099
  display: table-row;
@@ -3105,9 +3165,15 @@ tbody.collapse.in {
3105
  position: relative;
3106
  height: 0;
3107
  overflow: hidden;
3108
- -webkit-transition: height .35s ease;
3109
- -o-transition: height .35s ease;
3110
- transition: height .35s ease;
 
 
 
 
 
 
3111
  }
3112
  .caret {
3113
  display: inline-block;
@@ -3177,7 +3243,7 @@ tbody.collapse.in {
3177
  .dropdown-menu > .active > a:focus {
3178
  color: #fff;
3179
  text-decoration: none;
3180
- background-color: #428bca;
3181
  outline: 0;
3182
  }
3183
  .dropdown-menu > .disabled > a,
@@ -3270,10 +3336,6 @@ tbody.collapse.in {
3270
  .btn-group-vertical > .btn.active {
3271
  z-index: 2;
3272
  }
3273
- .btn-group > .btn:focus,
3274
- .btn-group-vertical > .btn:focus {
3275
- outline: 0;
3276
- }
3277
  .btn-group .btn + .btn,
3278
  .btn-group .btn + .btn-group,
3279
  .btn-group .btn-group + .btn,
@@ -3413,12 +3475,13 @@ tbody.collapse.in {
3413
  .btn-group-justified > .btn-group .dropdown-menu {
3414
  left: auto;
3415
  }
3416
- [data-toggle="buttons"] > .btn > input[type="radio"],
3417
- [data-toggle="buttons"] > .btn > input[type="checkbox"] {
 
 
3418
  position: absolute;
3419
- z-index: -1;
3420
- filter: alpha(opacity=0);
3421
- opacity: 0;
3422
  }
3423
  .input-group {
3424
  position: relative;
@@ -3607,7 +3670,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3607
  .nav .open > a:hover,
3608
  .nav .open > a:focus {
3609
  background-color: #eee;
3610
- border-color: #428bca;
3611
  }
3612
  .nav .nav-divider {
3613
  height: 1px;
@@ -3700,7 +3763,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3700
  .nav-pills > li.active > a:hover,
3701
  .nav-pills > li.active > a:focus {
3702
  color: #fff;
3703
- background-color: #428bca;
3704
  }
3705
  .nav-stacked > li {
3706
  float: none;
@@ -3757,9 +3820,11 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3757
  }
3758
  .tab-content > .tab-pane {
3759
  display: none;
 
3760
  }
3761
  .tab-content > .active {
3762
  display: block;
 
3763
  }
3764
  .nav-tabs .dropdown-menu {
3765
  margin-top: -1px;
@@ -3806,6 +3871,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3806
  height: auto !important;
3807
  padding-bottom: 0;
3808
  overflow: visible !important;
 
3809
  }
3810
  .navbar-collapse.in {
3811
  overflow-y: visible;
@@ -3821,7 +3887,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3821
  .navbar-fixed-bottom .navbar-collapse {
3822
  max-height: 340px;
3823
  }
3824
- @media (max-width: 480px) and (orientation: landscape) {
3825
  .navbar-fixed-top .navbar-collapse,
3826
  .navbar-fixed-bottom .navbar-collapse {
3827
  max-height: 200px;
@@ -3858,9 +3924,6 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3858
  right: 0;
3859
  left: 0;
3860
  z-index: 1030;
3861
- -webkit-transform: translate3d(0, 0, 0);
3862
- -o-transform: translate3d(0, 0, 0);
3863
- transform: translate3d(0, 0, 0);
3864
  }
3865
  @media (min-width: 768px) {
3866
  .navbar-fixed-top,
@@ -3888,6 +3951,9 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3888
  .navbar-brand:focus {
3889
  text-decoration: none;
3890
  }
 
 
 
3891
  @media (min-width: 768px) {
3892
  .navbar > .container .navbar-brand,
3893
  .navbar > .container-fluid .navbar-brand {
@@ -3966,17 +4032,6 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
3966
  padding-top: 15px;
3967
  padding-bottom: 15px;
3968
  }
3969
- .navbar-nav.navbar-right:last-child {
3970
- margin-right: -15px;
3971
- }
3972
- }
3973
- @media (min-width: 768px) {
3974
- .navbar-left {
3975
- float: left !important;
3976
- }
3977
- .navbar-right {
3978
- float: right !important;
3979
- }
3980
  }
3981
  .navbar-form {
3982
  padding: 10px 15px;
@@ -4000,6 +4055,9 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
4000
  width: auto;
4001
  vertical-align: middle;
4002
  }
 
 
 
4003
  .navbar-form .input-group {
4004
  display: inline-table;
4005
  vertical-align: middle;
@@ -4040,6 +4098,9 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
4040
  .navbar-form .form-group {
4041
  margin-bottom: 5px;
4042
  }
 
 
 
4043
  }
4044
  @media (min-width: 768px) {
4045
  .navbar-form {
@@ -4052,9 +4113,6 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
4052
  -webkit-box-shadow: none;
4053
  box-shadow: none;
4054
  }
4055
- .navbar-form.navbar-right:last-child {
4056
- margin-right: -15px;
4057
- }
4058
  }
4059
  .navbar-nav > li > .dropdown-menu {
4060
  margin-top: 0;
@@ -4062,6 +4120,8 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
4062
  border-top-right-radius: 0;
4063
  }
4064
  .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
 
 
4065
  border-bottom-right-radius: 0;
4066
  border-bottom-left-radius: 0;
4067
  }
@@ -4087,7 +4147,16 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
4087
  margin-right: 15px;
4088
  margin-left: 15px;
4089
  }
4090
- .navbar-text.navbar-right:last-child {
 
 
 
 
 
 
 
 
 
4091
  margin-right: 0;
4092
  }
4093
  }
@@ -4192,7 +4261,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
4192
  border-color: #080808;
4193
  }
4194
  .navbar-inverse .navbar-brand {
4195
- color: #777;
4196
  }
4197
  .navbar-inverse .navbar-brand:hover,
4198
  .navbar-inverse .navbar-brand:focus {
@@ -4200,10 +4269,10 @@ fieldset[disabled] .navbar-default .btn-link:focus {
4200
  background-color: transparent;
4201
  }
4202
  .navbar-inverse .navbar-text {
4203
- color: #777;
4204
  }
4205
  .navbar-inverse .navbar-nav > li > a {
4206
- color: #777;
4207
  }
4208
  .navbar-inverse .navbar-nav > li > a:hover,
4209
  .navbar-inverse .navbar-nav > li > a:focus {
@@ -4250,7 +4319,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
4250
  background-color: #080808;
4251
  }
4252
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
4253
- color: #777;
4254
  }
4255
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
4256
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
@@ -4271,13 +4340,13 @@ fieldset[disabled] .navbar-default .btn-link:focus {
4271
  }
4272
  }
4273
  .navbar-inverse .navbar-link {
4274
- color: #777;
4275
  }
4276
  .navbar-inverse .navbar-link:hover {
4277
  color: #fff;
4278
  }
4279
  .navbar-inverse .btn-link {
4280
- color: #777;
4281
  }
4282
  .navbar-inverse .btn-link:hover,
4283
  .navbar-inverse .btn-link:focus {
@@ -4323,7 +4392,7 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
4323
  padding: 6px 12px;
4324
  margin-left: -1px;
4325
  line-height: 1.42857143;
4326
- color: #428bca;
4327
  text-decoration: none;
4328
  background-color: #fff;
4329
  border: 1px solid #ddd;
@@ -4343,7 +4412,7 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
4343
  .pagination > li > span:hover,
4344
  .pagination > li > a:focus,
4345
  .pagination > li > span:focus {
4346
- color: #2a6496;
4347
  background-color: #eee;
4348
  border-color: #ddd;
4349
  }
@@ -4356,8 +4425,8 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
4356
  z-index: 2;
4357
  color: #fff;
4358
  cursor: default;
4359
- background-color: #428bca;
4360
- border-color: #428bca;
4361
  }
4362
  .pagination > .disabled > span,
4363
  .pagination > .disabled > span:hover,
@@ -4471,11 +4540,11 @@ a.label:focus {
4471
  background-color: #5e5e5e;
4472
  }
4473
  .label-primary {
4474
- background-color: #428bca;
4475
  }
4476
  .label-primary[href]:hover,
4477
  .label-primary[href]:focus {
4478
- background-color: #3071a9;
4479
  }
4480
  .label-success {
4481
  background-color: #5cb85c;
@@ -4536,16 +4605,22 @@ a.badge:focus {
4536
  text-decoration: none;
4537
  cursor: pointer;
4538
  }
4539
- a.list-group-item.active > .badge,
4540
  .nav-pills > .active > a > .badge {
4541
- color: #428bca;
4542
  background-color: #fff;
4543
  }
 
 
 
 
 
 
4544
  .nav-pills > li > a > .badge {
4545
  margin-left: 3px;
4546
  }
4547
  .jumbotron {
4548
- padding: 30px;
4549
  margin-bottom: 30px;
4550
  color: inherit;
4551
  background-color: #eee;
@@ -4562,7 +4637,8 @@ a.list-group-item.active > .badge,
4562
  .jumbotron > hr {
4563
  border-top-color: #d5d5d5;
4564
  }
4565
- .container .jumbotron {
 
4566
  border-radius: 6px;
4567
  }
4568
  .jumbotron .container {
@@ -4570,10 +4646,10 @@ a.list-group-item.active > .badge,
4570
  }
4571
  @media screen and (min-width: 768px) {
4572
  .jumbotron {
4573
- padding-top: 48px;
4574
- padding-bottom: 48px;
4575
  }
4576
- .container .jumbotron {
 
4577
  padding-right: 60px;
4578
  padding-left: 60px;
4579
  }
@@ -4590,9 +4666,9 @@ a.list-group-item.active > .badge,
4590
  background-color: #fff;
4591
  border: 1px solid #ddd;
4592
  border-radius: 4px;
4593
- -webkit-transition: all .2s ease-in-out;
4594
- -o-transition: all .2s ease-in-out;
4595
- transition: all .2s ease-in-out;
4596
  }
4597
  .thumbnail > img,
4598
  .thumbnail a > img {
@@ -4602,7 +4678,7 @@ a.list-group-item.active > .badge,
4602
  a.thumbnail:hover,
4603
  a.thumbnail:focus,
4604
  a.thumbnail.active {
4605
- border-color: #428bca;
4606
  }
4607
  .thumbnail .caption {
4608
  padding: 9px;
@@ -4724,7 +4800,7 @@ a.thumbnail.active {
4724
  line-height: 20px;
4725
  color: #fff;
4726
  text-align: center;
4727
- background-color: #428bca;
4728
  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
4729
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
4730
  -webkit-transition: width .6s ease;
@@ -4745,18 +4821,6 @@ a.thumbnail.active {
4745
  -o-animation: progress-bar-stripes 2s linear infinite;
4746
  animation: progress-bar-stripes 2s linear infinite;
4747
  }
4748
- .progress-bar[aria-valuenow="1"],
4749
- .progress-bar[aria-valuenow="2"] {
4750
- min-width: 30px;
4751
- }
4752
- .progress-bar[aria-valuenow="0"] {
4753
- min-width: 30px;
4754
- color: #777;
4755
- background-color: transparent;
4756
- background-image: none;
4757
- -webkit-box-shadow: none;
4758
- box-shadow: none;
4759
- }
4760
  .progress-bar-success {
4761
  background-color: #5cb85c;
4762
  }
@@ -4789,29 +4853,35 @@ a.thumbnail.active {
4789
  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
4790
  background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
4791
  }
4792
- .media,
4793
- .media-body {
4794
- overflow: hidden;
4795
- zoom: 1;
4796
- }
4797
- .media,
4798
- .media .media {
4799
  margin-top: 15px;
4800
  }
4801
  .media:first-child {
4802
  margin-top: 0;
4803
  }
4804
- .media-object {
4805
- display: block;
4806
- }
4807
- .media-heading {
4808
- margin: 0 0 5px;
4809
  }
 
4810
  .media > .pull-left {
4811
- margin-right: 10px;
4812
  }
4813
- .media > .pull-right {
4814
- margin-left: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
4815
  }
4816
  .media-list {
4817
  padding-left: 0;
@@ -4838,12 +4908,6 @@ a.thumbnail.active {
4838
  border-bottom-right-radius: 4px;
4839
  border-bottom-left-radius: 4px;
4840
  }
4841
- .list-group-item > .badge {
4842
- float: right;
4843
- }
4844
- .list-group-item > .badge + .badge {
4845
- margin-right: 5px;
4846
- }
4847
  a.list-group-item {
4848
  color: #555;
4849
  }
@@ -4860,6 +4924,7 @@ a.list-group-item:focus {
4860
  .list-group-item.disabled:hover,
4861
  .list-group-item.disabled:focus {
4862
  color: #777;
 
4863
  background-color: #eee;
4864
  }
4865
  .list-group-item.disabled .list-group-item-heading,
@@ -4877,8 +4942,8 @@ a.list-group-item:focus {
4877
  .list-group-item.active:focus {
4878
  z-index: 2;
4879
  color: #fff;
4880
- background-color: #428bca;
4881
- border-color: #428bca;
4882
  }
4883
  .list-group-item.active .list-group-item-heading,
4884
  .list-group-item.active:hover .list-group-item-heading,
@@ -4894,7 +4959,7 @@ a.list-group-item:focus {
4894
  .list-group-item.active .list-group-item-text,
4895
  .list-group-item.active:hover .list-group-item-text,
4896
  .list-group-item.active:focus .list-group-item-text {
4897
- color: #e1edf7;
4898
  }
4899
  .list-group-item-success {
4900
  color: #3c763d;
@@ -5028,19 +5093,23 @@ a.list-group-item-danger.active:focus {
5028
  border-bottom-right-radius: 3px;
5029
  border-bottom-left-radius: 3px;
5030
  }
5031
- .panel > .list-group {
 
5032
  margin-bottom: 0;
5033
  }
5034
- .panel > .list-group .list-group-item {
 
5035
  border-width: 1px 0;
5036
  border-radius: 0;
5037
  }
5038
- .panel > .list-group:first-child .list-group-item:first-child {
 
5039
  border-top: 0;
5040
  border-top-left-radius: 3px;
5041
  border-top-right-radius: 3px;
5042
  }
5043
- .panel > .list-group:last-child .list-group-item:last-child {
 
5044
  border-bottom: 0;
5045
  border-bottom-right-radius: 3px;
5046
  border-bottom-left-radius: 3px;
@@ -5056,11 +5125,24 @@ a.list-group-item-danger.active:focus {
5056
  .panel > .panel-collapse > .table {
5057
  margin-bottom: 0;
5058
  }
 
 
 
 
 
 
5059
  .panel > .table:first-child,
5060
  .panel > .table-responsive:first-child > .table:first-child {
5061
  border-top-left-radius: 3px;
5062
  border-top-right-radius: 3px;
5063
  }
 
 
 
 
 
 
 
5064
  .panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
5065
  .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
5066
  .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
@@ -5086,6 +5168,13 @@ a.list-group-item-danger.active:focus {
5086
  border-bottom-right-radius: 3px;
5087
  border-bottom-left-radius: 3px;
5088
  }
 
 
 
 
 
 
 
5089
  .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
5090
  .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
5091
  .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
@@ -5107,7 +5196,9 @@ a.list-group-item-danger.active:focus {
5107
  border-bottom-right-radius: 3px;
5108
  }
5109
  .panel > .panel-body + .table,
5110
- .panel > .panel-body + .table-responsive {
 
 
5111
  border-top: 1px solid #ddd;
5112
  }
5113
  .panel > .table > tbody:first-child > tr:first-child th,
@@ -5183,7 +5274,8 @@ a.list-group-item-danger.active:focus {
5183
  .panel-group .panel-heading {
5184
  border-bottom: 0;
5185
  }
5186
- .panel-group .panel-heading + .panel-collapse > .panel-body {
 
5187
  border-top: 1px solid #ddd;
5188
  }
5189
  .panel-group .panel-footer {
@@ -5211,22 +5303,22 @@ a.list-group-item-danger.active:focus {
5211
  border-bottom-color: #ddd;
5212
  }
5213
  .panel-primary {
5214
- border-color: #428bca;
5215
  }
5216
  .panel-primary > .panel-heading {
5217
  color: #fff;
5218
- background-color: #428bca;
5219
- border-color: #428bca;
5220
  }
5221
  .panel-primary > .panel-heading + .panel-collapse > .panel-body {
5222
- border-top-color: #428bca;
5223
  }
5224
  .panel-primary > .panel-heading .badge {
5225
- color: #428bca;
5226
  background-color: #fff;
5227
  }
5228
  .panel-primary > .panel-footer + .panel-collapse > .panel-body {
5229
- border-bottom-color: #428bca;
5230
  }
5231
  .panel-success {
5232
  border-color: #d6e9c6;
@@ -5310,7 +5402,8 @@ a.list-group-item-danger.active:focus {
5310
  .embed-responsive .embed-responsive-item,
5311
  .embed-responsive iframe,
5312
  .embed-responsive embed,
5313
- .embed-responsive object {
 
5314
  position: absolute;
5315
  top: 0;
5316
  bottom: 0;
@@ -5381,7 +5474,7 @@ button.close {
5381
  right: 0;
5382
  bottom: 0;
5383
  left: 0;
5384
- z-index: 1050;
5385
  display: none;
5386
  overflow: hidden;
5387
  -webkit-overflow-scrolling: touch;
@@ -5391,14 +5484,16 @@ button.close {
5391
  -webkit-transition: -webkit-transform .3s ease-out;
5392
  -o-transition: -o-transform .3s ease-out;
5393
  transition: transform .3s ease-out;
5394
- -webkit-transform: translate3d(0, -25%, 0);
5395
- -o-transform: translate3d(0, -25%, 0);
5396
- transform: translate3d(0, -25%, 0);
 
5397
  }
5398
  .modal.in .modal-dialog {
5399
- -webkit-transform: translate3d(0, 0, 0);
5400
- -o-transform: translate3d(0, 0, 0);
5401
- transform: translate3d(0, 0, 0);
 
5402
  }
5403
  .modal-open .modal {
5404
  overflow-x: hidden;
@@ -5422,12 +5517,10 @@ button.close {
5422
  box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
5423
  }
5424
  .modal-backdrop {
5425
- position: fixed;
5426
  top: 0;
5427
  right: 0;
5428
- bottom: 0;
5429
  left: 0;
5430
- z-index: 1040;
5431
  background-color: #000;
5432
  }
5433
  .modal-backdrop.fade {
@@ -5498,7 +5591,9 @@ button.close {
5498
  position: absolute;
5499
  z-index: 1070;
5500
  display: block;
 
5501
  font-size: 12px;
 
5502
  line-height: 1.4;
5503
  visibility: visible;
5504
  filter: alpha(opacity=0);
@@ -5548,14 +5643,16 @@ button.close {
5548
  border-top-color: #000;
5549
  }
5550
  .tooltip.top-left .tooltip-arrow {
 
5551
  bottom: 0;
5552
- left: 5px;
5553
  border-width: 5px 5px 0;
5554
  border-top-color: #000;
5555
  }
5556
  .tooltip.top-right .tooltip-arrow {
5557
- right: 5px;
5558
  bottom: 0;
 
 
5559
  border-width: 5px 5px 0;
5560
  border-top-color: #000;
5561
  }
@@ -5582,13 +5679,15 @@ button.close {
5582
  }
5583
  .tooltip.bottom-left .tooltip-arrow {
5584
  top: 0;
5585
- left: 5px;
 
5586
  border-width: 0 5px 5px;
5587
  border-bottom-color: #000;
5588
  }
5589
  .tooltip.bottom-right .tooltip-arrow {
5590
  top: 0;
5591
- right: 5px;
 
5592
  border-width: 0 5px 5px;
5593
  border-bottom-color: #000;
5594
  }
@@ -5600,6 +5699,10 @@ button.close {
5600
  display: none;
5601
  max-width: 276px;
5602
  padding: 1px;
 
 
 
 
5603
  text-align: left;
5604
  white-space: normal;
5605
  background-color: #fff;
@@ -5627,8 +5730,6 @@ button.close {
5627
  padding: 8px 14px;
5628
  margin: 0;
5629
  font-size: 14px;
5630
- font-weight: normal;
5631
- line-height: 18px;
5632
  background-color: #f7f7f7;
5633
  border-bottom: 1px solid #ebebeb;
5634
  border-radius: 5px 5px 0 0;
@@ -5731,6 +5832,37 @@ button.close {
5731
  .carousel-inner > .item > a > img {
5732
  line-height: 1;
5733
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5734
  .carousel-inner > .active,
5735
  .carousel-inner > .next,
5736
  .carousel-inner > .prev {
@@ -5986,9 +6118,6 @@ button.close {
5986
  }
5987
  .affix {
5988
  position: fixed;
5989
- -webkit-transform: translate3d(0, 0, 0);
5990
- -o-transform: translate3d(0, 0, 0);
5991
- transform: translate3d(0, 0, 0);
5992
  }
5993
  @-ms-viewport {
5994
  width: device-width;
1
  /*!
2
+ * Bootstrap v3.3.1 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
 
7
+ /*! normalize.css v3.0.2 | MIT License | git.io/normalize */
8
  html {
9
  font-family: sans-serif;
10
  -webkit-text-size-adjust: 100%;
22
  header,
23
  hgroup,
24
  main,
25
+ menu,
26
  nav,
27
  section,
28
  summary {
44
  display: none;
45
  }
46
  a {
47
+ background-color: transparent;
48
  }
49
  a:active,
50
  a:hover {
188
  th {
189
  padding: 0;
190
  }
191
+ /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
192
  @media print {
193
+ *,
194
+ *:before,
195
+ *:after {
196
  color: #000 !important;
197
  text-shadow: none !important;
198
  background: transparent !important;
209
  abbr[title]:after {
210
  content: " (" attr(title) ")";
211
  }
212
+ a[href^="#"]:after,
213
+ a[href^="javascript:"]:after {
214
  content: "";
215
  }
216
  pre,
245
  .navbar {
246
  display: none;
247
  }
 
 
 
 
248
  .btn > .caret,
249
  .dropup > .btn > .caret {
250
  border-top-color: #000 !important;
255
  .table {
256
  border-collapse: collapse !important;
257
  }
258
+ .table td,
259
+ .table th {
260
+ background-color: #fff !important;
261
+ }
262
  .table-bordered th,
263
  .table-bordered td {
264
  border: 1px solid #ddd !important;
288
  .glyphicon-plus:before {
289
  content: "\2b";
290
  }
291
+ .glyphicon-euro:before,
292
+ .glyphicon-eur:before {
293
  content: "\20ac";
294
  }
295
  .glyphicon-minus:before {
915
  line-height: inherit;
916
  }
917
  a {
918
+ color: #337ab7;
919
  text-decoration: none;
920
  }
921
  a:hover,
922
  a:focus {
923
+ color: #23527c;
924
  text-decoration: underline;
925
  }
926
  a:focus {
940
  .carousel-inner > .item > img,
941
  .carousel-inner > .item > a > img {
942
  display: block;
 
943
  max-width: 100%;
944
  height: auto;
945
  }
948
  }
949
  .img-thumbnail {
950
  display: inline-block;
 
951
  max-width: 100%;
952
  height: auto;
953
  padding: 4px;
1120
  .small {
1121
  font-size: 85%;
1122
  }
 
 
 
1123
  mark,
1124
  .mark {
1125
  padding: .2em;
1153
  color: #777;
1154
  }
1155
  .text-primary {
1156
+ color: #337ab7;
1157
  }
1158
  a.text-primary:hover {
1159
+ color: #286090;
1160
  }
1161
  .text-success {
1162
  color: #3c763d;
1184
  }
1185
  .bg-primary {
1186
  color: #fff;
1187
+ background-color: #337ab7;
1188
  }
1189
  a.bg-primary:hover {
1190
+ background-color: #286090;
1191
  }
1192
  .bg-success {
1193
  background-color: #dff0d8;
1328
  blockquote.pull-right .small:after {
1329
  content: '\00A0 \2014';
1330
  }
 
 
 
 
1331
  address {
1332
  margin-bottom: 20px;
1333
  font-style: normal;
1358
  kbd kbd {
1359
  padding: 0;
1360
  font-size: 100%;
1361
+ font-weight: bold;
1362
  -webkit-box-shadow: none;
1363
  box-shadow: none;
1364
  }
2057
  table {
2058
  background-color: transparent;
2059
  }
2060
+ caption {
2061
+ padding-top: 8px;
2062
+ padding-bottom: 8px;
2063
+ color: #777;
2064
+ text-align: left;
2065
+ }
2066
  th {
2067
  text-align: left;
2068
  }
2123
  .table-bordered > thead > tr > td {
2124
  border-bottom-width: 2px;
2125
  }
2126
+ .table-striped > tbody > tr:nth-child(odd) {
 
2127
  background-color: #f9f9f9;
2128
  }
2129
+ .table-hover > tbody > tr:hover {
 
2130
  background-color: #f5f5f5;
2131
  }
2132
  table col[class*="col-"] {
2245
  .table-hover > tbody > tr.danger:hover > th {
2246
  background-color: #ebcccc;
2247
  }
2248
+ .table-responsive {
2249
+ min-height: .01%;
2250
+ overflow-x: auto;
2251
+ }
2252
  @media screen and (max-width: 767px) {
2253
  .table-responsive {
2254
  width: 100%;
2255
  margin-bottom: 15px;
 
2256
  overflow-y: hidden;
 
2257
  -ms-overflow-style: -ms-autohiding-scrollbar;
2258
  border: 1px solid #ddd;
2259
  }
2378
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
2379
  }
2380
  .form-control::-moz-placeholder {
2381
+ color: #999;
2382
  opacity: 1;
2383
  }
2384
  .form-control:-ms-input-placeholder {
2385
+ color: #999;
2386
  }
2387
  .form-control::-webkit-input-placeholder {
2388
+ color: #999;
2389
  }
2390
  .form-control[disabled],
2391
  .form-control[readonly],
2400
  input[type="search"] {
2401
  -webkit-appearance: none;
2402
  }
2403
+ @media screen and (-webkit-min-device-pixel-ratio: 0) {
2404
+ input[type="date"],
2405
+ input[type="time"],
2406
+ input[type="datetime-local"],
2407
+ input[type="month"] {
2408
+ line-height: 34px;
2409
+ }
2410
+ input[type="date"].input-sm,
2411
+ input[type="time"].input-sm,
2412
+ input[type="datetime-local"].input-sm,
2413
+ input[type="month"].input-sm {
2414
+ line-height: 30px;
2415
+ }
2416
+ input[type="date"].input-lg,
2417
+ input[type="time"].input-lg,
2418
+ input[type="datetime-local"].input-lg,
2419
+ input[type="month"].input-lg {
2420
+ line-height: 46px;
2421
+ }
2422
  }
2423
  .form-group {
2424
  margin-bottom: 15px;
2427
  .checkbox {
2428
  position: relative;
2429
  display: block;
 
2430
  margin-top: 10px;
2431
  margin-bottom: 10px;
2432
  }
2433
  .radio label,
2434
  .checkbox label {
2435
+ min-height: 20px;
2436
  padding-left: 20px;
2437
  margin-bottom: 0;
2438
  font-weight: normal;
2495
  padding-left: 0;
2496
  }
2497
  .input-sm,
2498
+ .form-group-sm .form-control {
2499
  height: 30px;
2500
  padding: 5px 10px;
2501
  font-size: 12px;
2502
  line-height: 1.5;
2503
  border-radius: 3px;
2504
  }
2505
+ select.input-sm,
2506
+ select.form-group-sm .form-control {
2507
  height: 30px;
2508
  line-height: 30px;
2509
  }
2510
  textarea.input-sm,
2511
+ textarea.form-group-sm .form-control,
2512
+ select[multiple].input-sm,
2513
+ select[multiple].form-group-sm .form-control {
2514
  height: auto;
2515
  }
2516
  .input-lg,
2517
+ .form-group-lg .form-control {
2518
  height: 46px;
2519
  padding: 10px 16px;
2520
  font-size: 18px;
2521
  line-height: 1.33;
2522
  border-radius: 6px;
2523
  }
2524
+ select.input-lg,
2525
+ select.form-group-lg .form-control {
2526
  height: 46px;
2527
  line-height: 46px;
2528
  }
2529
  textarea.input-lg,
2530
+ textarea.form-group-lg .form-control,
2531
+ select[multiple].input-lg,
2532
+ select[multiple].form-group-lg .form-control {
2533
  height: auto;
2534
  }
2535
  .has-feedback {
2540
  }
2541
  .form-control-feedback {
2542
  position: absolute;
2543
+ top: 0;
2544
  right: 0;
2545
  z-index: 2;
2546
  display: block;
2548
  height: 34px;
2549
  line-height: 34px;
2550
  text-align: center;
2551
+ pointer-events: none;
2552
  }
2553
  .input-lg + .form-control-feedback {
2554
  width: 46px;
2565
  .has-success .radio,
2566
  .has-success .checkbox,
2567
  .has-success .radio-inline,
2568
+ .has-success .checkbox-inline,
2569
+ .has-success.radio label,
2570
+ .has-success.checkbox label,
2571
+ .has-success.radio-inline label,
2572
+ .has-success.checkbox-inline label {
2573
  color: #3c763d;
2574
  }
2575
  .has-success .form-control {
2595
  .has-warning .radio,
2596
  .has-warning .checkbox,
2597
  .has-warning .radio-inline,
2598
+ .has-warning .checkbox-inline,
2599
+ .has-warning.radio label,
2600
+ .has-warning.checkbox label,
2601
+ .has-warning.radio-inline label,
2602
+ .has-warning.checkbox-inline label {
2603
  color: #8a6d3b;
2604
  }
2605
  .has-warning .form-control {
2625
  .has-error .radio,
2626
  .has-error .checkbox,
2627
  .has-error .radio-inline,
2628
+ .has-error .checkbox-inline,
2629
+ .has-error.radio label,
2630
+ .has-error.checkbox label,
2631
+ .has-error.radio-inline label,
2632
+ .has-error.checkbox-inline label {
2633
  color: #a94442;
2634
  }
2635
  .has-error .form-control {
2650
  .has-error .form-control-feedback {
2651
  color: #a94442;
2652
  }
2653
+ .has-feedback label ~ .form-control-feedback {
2654
+ top: 25px;
2655
+ }
2656
  .has-feedback label.sr-only ~ .form-control-feedback {
2657
  top: 0;
2658
  }
2673
  width: auto;
2674
  vertical-align: middle;
2675
  }
2676
+ .form-inline .form-control-static {
2677
+ display: inline-block;
2678
+ }
2679
  .form-inline .input-group {
2680
  display: inline-table;
2681
  vertical-align: middle;
2736
  }
2737
  }
2738
  .form-horizontal .has-feedback .form-control-feedback {
 
2739
  right: 15px;
2740
  }
2741
  @media (min-width: 768px) {
2758
  text-align: center;
2759
  white-space: nowrap;
2760
  vertical-align: middle;
2761
+ -ms-touch-action: manipulation;
2762
+ touch-action: manipulation;
2763
  cursor: pointer;
2764
  -webkit-user-select: none;
2765
  -moz-user-select: none;
2771
  }
2772
  .btn:focus,
2773
  .btn:active:focus,
2774
+ .btn.active:focus,
2775
+ .btn.focus,
2776
+ .btn:active.focus,
2777
+ .btn.active.focus {
2778
  outline: thin dotted;
2779
  outline: 5px auto -webkit-focus-ring-color;
2780
  outline-offset: -2px;
2781
  }
2782
  .btn:hover,
2783
+ .btn:focus,
2784
+ .btn.focus {
2785
  color: #333;
2786
  text-decoration: none;
2787
  }
2809
  }
2810
  .btn-default:hover,
2811
  .btn-default:focus,
2812
+ .btn-default.focus,
2813
  .btn-default:active,
2814
  .btn-default.active,
2815
  .open > .dropdown-toggle.btn-default {
2831
  .btn-default.disabled:focus,
2832
  .btn-default[disabled]:focus,
2833
  fieldset[disabled] .btn-default:focus,
2834
+ .btn-default.disabled.focus,
2835
+ .btn-default[disabled].focus,
2836
+ fieldset[disabled] .btn-default.focus,
2837
  .btn-default.disabled:active,
2838
  .btn-default[disabled]:active,
2839
  fieldset[disabled] .btn-default:active,
2849
  }
2850
  .btn-primary {
2851
  color: #fff;
2852
+ background-color: #337ab7;
2853
+ border-color: #2e6da4;
2854
  }
2855
  .btn-primary:hover,
2856
  .btn-primary:focus,
2857
+ .btn-primary.focus,
2858
  .btn-primary:active,
2859
  .btn-primary.active,
2860
  .open > .dropdown-toggle.btn-primary {
2861
  color: #fff;
2862
+ background-color: #286090;
2863
+ border-color: #204d74;
2864
  }
2865
  .btn-primary:active,
2866
  .btn-primary.active,
2876
  .btn-primary.disabled:focus,
2877
  .btn-primary[disabled]:focus,
2878
  fieldset[disabled] .btn-primary:focus,
2879
+ .btn-primary.disabled.focus,
2880
+ .btn-primary[disabled].focus,
2881
+ fieldset[disabled] .btn-primary.focus,
2882
  .btn-primary.disabled:active,
2883
  .btn-primary[disabled]:active,
2884
  fieldset[disabled] .btn-primary:active,
2885
  .btn-primary.disabled.active,
2886
  .btn-primary[disabled].active,
2887
  fieldset[disabled] .btn-primary.active {
2888
+ background-color: #337ab7;
2889
+ border-color: #2e6da4;
2890
  }
2891
  .btn-primary .badge {
2892
+ color: #337ab7;
2893
  background-color: #fff;
2894
  }
2895
  .btn-success {
2899
  }
2900
  .btn-success:hover,
2901
  .btn-success:focus,
2902
+ .btn-success.focus,
2903
  .btn-success:active,
2904
  .btn-success.active,
2905
  .open > .dropdown-toggle.btn-success {
2921
  .btn-success.disabled:focus,
2922
  .btn-success[disabled]:focus,
2923
  fieldset[disabled] .btn-success:focus,
2924
+ .btn-success.disabled.focus,
2925
+ .btn-success[disabled].focus,
2926
+ fieldset[disabled] .btn-success.focus,
2927
  .btn-success.disabled:active,
2928
  .btn-success[disabled]:active,
2929
  fieldset[disabled] .btn-success:active,
2944
  }
2945
  .btn-info:hover,
2946
  .btn-info:focus,
2947
+ .btn-info.focus,
2948
  .btn-info:active,
2949
  .btn-info.active,
2950
  .open > .dropdown-toggle.btn-info {
2966
  .btn-info.disabled:focus,
2967
  .btn-info[disabled]:focus,
2968
  fieldset[disabled] .btn-info:focus,
2969
+ .btn-info.disabled.focus,
2970
+ .btn-info[disabled].focus,
2971
+ fieldset[disabled] .btn-info.focus,
2972
  .btn-info.disabled:active,
2973
  .btn-info[disabled]:active,
2974
  fieldset[disabled] .btn-info:active,
2989
  }
2990
  .btn-warning:hover,
2991
  .btn-warning:focus,
2992
+ .btn-warning.focus,
2993
  .btn-warning:active,
2994
  .btn-warning.active,
2995
  .open > .dropdown-toggle.btn-warning {
3011
  .btn-warning.disabled:focus,
3012
  .btn-warning[disabled]:focus,
3013
  fieldset[disabled] .btn-warning:focus,
3014
+ .btn-warning.disabled.focus,
3015
+ .btn-warning[disabled].focus,
3016
+ fieldset[disabled] .btn-warning.focus,
3017
  .btn-warning.disabled:active,
3018
  .btn-warning[disabled]:active,
3019
  fieldset[disabled] .btn-warning:active,
3034
  }
3035
  .btn-danger:hover,
3036
  .btn-danger:focus,
3037
+ .btn-danger.focus,
3038
  .btn-danger:active,
3039
  .btn-danger.active,
3040
  .open > .dropdown-toggle.btn-danger {
3056
  .btn-danger.disabled:focus,
3057
  .btn-danger[disabled]:focus,
3058
  fieldset[disabled] .btn-danger:focus,
3059
+ .btn-danger.disabled.focus,
3060
+ .btn-danger[disabled].focus,
3061
+ fieldset[disabled] .btn-danger.focus,
3062
  .btn-danger.disabled:active,
3063
  .btn-danger[disabled]:active,
3064
  fieldset[disabled] .btn-danger:active,
3074
  }
3075
  .btn-link {
3076
  font-weight: normal;
3077
+ color: #337ab7;
 
3078
  border-radius: 0;
3079
  }
3080
  .btn-link,
3081
  .btn-link:active,
3082
+ .btn-link.active,
3083
  .btn-link[disabled],
3084
  fieldset[disabled] .btn-link {
3085
  background-color: transparent;
3094
  }
3095
  .btn-link:hover,
3096
  .btn-link:focus {
3097
+ color: #23527c;
3098
  text-decoration: underline;
3099
  background-color: transparent;
3100
  }
3149
  }
3150
  .collapse {
3151
  display: none;
3152
+ visibility: hidden;
3153
  }
3154
  .collapse.in {
3155
  display: block;
3156
+ visibility: visible;
3157
  }
3158
  tr.collapse.in {
3159
  display: table-row;
3165
  position: relative;
3166
  height: 0;
3167
  overflow: hidden;
3168
+ -webkit-transition-timing-function: ease;
3169
+ -o-transition-timing-function: ease;
3170
+ transition-timing-function: ease;
3171
+ -webkit-transition-duration: .35s;
3172
+ -o-transition-duration: .35s;
3173
+ transition-duration: .35s;
3174
+ -webkit-transition-property: height, visibility;
3175
+ -o-transition-property: height, visibility;
3176
+ transition-property: height, visibility;
3177
  }
3178
  .caret {
3179
  display: inline-block;
3243
  .dropdown-menu > .active > a:focus {
3244
  color: #fff;
3245
  text-decoration: none;
3246
+ background-color: #337ab7;
3247
  outline: 0;
3248
  }
3249
  .dropdown-menu > .disabled > a,
3336
  .btn-group-vertical > .btn.active {
3337
  z-index: 2;
3338
  }
 
 
 
 
3339
  .btn-group .btn + .btn,
3340
  .btn-group .btn + .btn-group,
3341
  .btn-group .btn-group + .btn,
3475
  .btn-group-justified > .btn-group .dropdown-menu {
3476
  left: auto;
3477
  }
3478
+ [data-toggle="buttons"] > .btn input[type="radio"],
3479
+ [data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
3480
+ [data-toggle="buttons"] > .btn input[type="checkbox"],
3481
+ [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
3482
  position: absolute;
3483
+ clip: rect(0, 0, 0, 0);
3484
+ pointer-events: none;
 
3485
  }
3486
  .input-group {
3487
  position: relative;
3670
  .nav .open > a:hover,
3671
  .nav .open > a:focus {
3672
  background-color: #eee;
3673
+ border-color: #337ab7;
3674
  }
3675
  .nav .nav-divider {
3676
  height: 1px;
3763
  .nav-pills > li.active > a:hover,
3764
  .nav-pills > li.active > a:focus {
3765
  color: #fff;
3766
+ background-color: #337ab7;
3767
  }
3768
  .nav-stacked > li {
3769
  float: none;
3820
  }
3821
  .tab-content > .tab-pane {
3822
  display: none;
3823
+ visibility: hidden;
3824
  }
3825
  .tab-content > .active {
3826
  display: block;
3827
+ visibility: visible;
3828
  }
3829
  .nav-tabs .dropdown-menu {
3830
  margin-top: -1px;
3871
  height: auto !important;
3872
  padding-bottom: 0;
3873
  overflow: visible !important;
3874
+ visibility: visible !important;
3875
  }
3876
  .navbar-collapse.in {
3877
  overflow-y: visible;
3887
  .navbar-fixed-bottom .navbar-collapse {
3888
  max-height: 340px;
3889
  }
3890
+ @media (max-device-width: 480px) and (orientation: landscape) {
3891
  .navbar-fixed-top .navbar-collapse,
3892
  .navbar-fixed-bottom .navbar-collapse {
3893
  max-height: 200px;
3924
  right: 0;
3925
  left: 0;
3926
  z-index: 1030;
 
 
 
3927
  }
3928
  @media (min-width: 768px) {
3929
  .navbar-fixed-top,
3951
  .navbar-brand:focus {
3952
  text-decoration: none;
3953
  }
3954
+ .navbar-brand > img {
3955
+ display: block;
3956
+ }
3957
  @media (min-width: 768px) {
3958
  .navbar > .container .navbar-brand,
3959
  .navbar > .container-fluid .navbar-brand {
4032
  padding-top: 15px;
4033
  padding-bottom: 15px;
4034
  }
 
 
 
 
 
 
 
 
 
 
 
4035
  }
4036
  .navbar-form {
4037
  padding: 10px 15px;
4055
  width: auto;
4056
  vertical-align: middle;
4057
  }
4058
+ .navbar-form .form-control-static {
4059
+ display: inline-block;
4060
+ }
4061
  .navbar-form .input-group {
4062
  display: inline-table;
4063
  vertical-align: middle;
4098
  .navbar-form .form-group {
4099
  margin-bottom: 5px;
4100
  }
4101
+ .navbar-form .form-group:last-child {
4102
+ margin-bottom: 0;
4103
+ }
4104
  }
4105
  @media (min-width: 768px) {
4106
  .navbar-form {
4113
  -webkit-box-shadow: none;
4114
  box-shadow: none;
4115
  }
 
 
 
4116
  }
4117
  .navbar-nav > li > .dropdown-menu {
4118
  margin-top: 0;
4120
  border-top-right-radius: 0;
4121
  }
4122
  .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
4123
+ border-top-left-radius: 4px;
4124
+ border-top-right-radius: 4px;
4125
  border-bottom-right-radius: 0;
4126
  border-bottom-left-radius: 0;
4127
  }
4147
  margin-right: 15px;
4148
  margin-left: 15px;
4149
  }
4150
+ }
4151
+ @media (min-width: 768px) {
4152
+ .navbar-left {
4153
+ float: left !important;
4154
+ }
4155
+ .navbar-right {
4156
+ float: right !important;
4157
+ margin-right: -15px;
4158
+ }
4159
+ .navbar-right ~ .navbar-right {
4160
  margin-right: 0;
4161
  }
4162
  }
4261
  border-color: #080808;
4262
  }
4263
  .navbar-inverse .navbar-brand {
4264
+ color: #9d9d9d;
4265
  }
4266
  .navbar-inverse .navbar-brand:hover,
4267
  .navbar-inverse .navbar-brand:focus {
4269
  background-color: transparent;
4270
  }
4271
  .navbar-inverse .navbar-text {
4272
+ color: #9d9d9d;
4273
  }
4274
  .navbar-inverse .navbar-nav > li > a {
4275
+ color: #9d9d9d;
4276
  }
4277
  .navbar-inverse .navbar-nav > li > a:hover,
4278
  .navbar-inverse .navbar-nav > li > a:focus {
4319
  background-color: #080808;
4320
  }
4321
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
4322
+ color: #9d9d9d;
4323
  }
4324
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
4325
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
4340
  }
4341
  }
4342
  .navbar-inverse .navbar-link {
4343
+ color: #9d9d9d;
4344
  }
4345
  .navbar-inverse .navbar-link:hover {
4346
  color: #fff;
4347
  }
4348
  .navbar-inverse .btn-link {
4349
+ color: #9d9d9d;
4350
  }
4351
  .navbar-inverse .btn-link:hover,
4352
  .navbar-inverse .btn-link:focus {
4392
  padding: 6px 12px;
4393
  margin-left: -1px;
4394
  line-height: 1.42857143;
4395
+ color: #337ab7;
4396
  text-decoration: none;
4397
  background-color: #fff;
4398
  border: 1px solid #ddd;
4412
  .pagination > li > span:hover,
4413
  .pagination > li > a:focus,
4414
  .pagination > li > span:focus {
4415
+ color: #23527c;
4416
  background-color: #eee;
4417
  border-color: #ddd;
4418
  }
4425
  z-index: 2;
4426
  color: #fff;
4427
  cursor: default;
4428
+ background-color: #337ab7;
4429
+ border-color: #337ab7;
4430
  }
4431
  .pagination > .disabled > span,
4432
  .pagination > .disabled > span:hover,
4540
  background-color: #5e5e5e;
4541
  }
4542
  .label-primary {
4543
+ background-color: #337ab7;
4544
  }
4545
  .label-primary[href]:hover,
4546
  .label-primary[href]:focus {
4547
+ background-color: #286090;
4548
  }
4549
  .label-success {
4550
  background-color: #5cb85c;
4605
  text-decoration: none;
4606
  cursor: pointer;
4607
  }
4608
+ .list-group-item.active > .badge,
4609
  .nav-pills > .active > a > .badge {
4610
+ color: #337ab7;
4611
  background-color: #fff;
4612
  }
4613
+ .list-group-item > .badge {
4614
+ float: right;
4615
+ }
4616
+ .list-group-item > .badge + .badge {
4617
+ margin-right: 5px;
4618
+ }
4619
  .nav-pills > li > a > .badge {
4620
  margin-left: 3px;
4621
  }
4622
  .jumbotron {
4623
+ padding: 30px 15px;
4624
  margin-bottom: 30px;
4625
  color: inherit;
4626
  background-color: #eee;
4637
  .jumbotron > hr {
4638
  border-top-color: #d5d5d5;
4639
  }
4640
+ .container .jumbotron,
4641
+ .container-fluid .jumbotron {
4642
  border-radius: 6px;
4643
  }
4644
  .jumbotron .container {
4646
  }
4647
  @media screen and (min-width: 768px) {
4648
  .jumbotron {
4649
+ padding: 48px 0;
 
4650
  }
4651
+ .container .jumbotron,
4652
+ .container-fluid .jumbotron {
4653
  padding-right: 60px;
4654
  padding-left: 60px;
4655
  }
4666
  background-color: #fff;
4667
  border: 1px solid #ddd;
4668
  border-radius: 4px;
4669
+ -webkit-transition: border .2s ease-in-out;
4670
+ -o-transition: border .2s ease-in-out;
4671
+ transition: border .2s ease-in-out;
4672
  }
4673
  .thumbnail > img,
4674
  .thumbnail a > img {
4678
  a.thumbnail:hover,
4679
  a.thumbnail:focus,
4680
  a.thumbnail.active {
4681
+ border-color: #337ab7;
4682
  }
4683
  .thumbnail .caption {
4684
  padding: 9px;
4800
  line-height: 20px;
4801
  color: #fff;
4802
  text-align: center;
4803
+ background-color: #337ab7;
4804
  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
4805
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
4806
  -webkit-transition: width .6s ease;
4821
  -o-animation: progress-bar-stripes 2s linear infinite;
4822
  animation: progress-bar-stripes 2s linear infinite;
4823
  }
 
 
 
 
 
 
 
 
 
 
 
 
4824
  .progress-bar-success {
4825
  background-color: #5cb85c;
4826
  }
4853
  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
4854
  background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
4855
  }
4856
+ .media {
 
 
 
 
 
 
4857
  margin-top: 15px;
4858
  }
4859
  .media:first-child {
4860
  margin-top: 0;
4861
  }
4862
+ .media-right,
4863
+ .media > .pull-right {
4864
+ padding-left: 10px;
 
 
4865
  }
4866
+ .media-left,
4867
  .media > .pull-left {
4868
+ padding-right: 10px;
4869
  }
4870
+ .media-left,
4871
+ .media-right,
4872
+ .media-body {
4873
+ display: table-cell;
4874
+ vertical-align: top;
4875
+ }
4876
+ .media-middle {
4877
+ vertical-align: middle;
4878
+ }
4879
+ .media-bottom {
4880
+ vertical-align: bottom;
4881
+ }
4882
+ .media-heading {
4883
+ margin-top: 0;
4884
+ margin-bottom: 5px;
4885
  }
4886
  .media-list {
4887
  padding-left: 0;
4908
  border-bottom-right-radius: 4px;
4909
  border-bottom-left-radius: 4px;
4910
  }
 
 
 
 
 
 
4911
  a.list-group-item {
4912
  color: #555;
4913
  }
4924
  .list-group-item.disabled:hover,
4925
  .list-group-item.disabled:focus {
4926
  color: #777;
4927
+ cursor: not-allowed;
4928
  background-color: #eee;
4929
  }
4930
  .list-group-item.disabled .list-group-item-heading,
4942
  .list-group-item.active:focus {
4943
  z-index: 2;
4944
  color: #fff;
4945
+ background-color: #337ab7;
4946
+ border-color: #337ab7;
4947
  }
4948
  .list-group-item.active .list-group-item-heading,
4949
  .list-group-item.active:hover .list-group-item-heading,
4959
  .list-group-item.active .list-group-item-text,
4960
  .list-group-item.active:hover .list-group-item-text,
4961
  .list-group-item.active:focus .list-group-item-text {
4962
+ color: #c7ddef;
4963
  }
4964
  .list-group-item-success {
4965
  color: #3c763d;
5093
  border-bottom-right-radius: 3px;
5094
  border-bottom-left-radius: 3px;
5095
  }
5096
+ .panel > .list-group,
5097
+ .panel > .panel-collapse > .list-group {
5098
  margin-bottom: 0;
5099
  }
5100
+ .panel > .list-group .list-group-item,
5101
+ .panel > .panel-collapse > .list-group .list-group-item {
5102
  border-width: 1px 0;
5103
  border-radius: 0;
5104
  }
5105
+ .panel > .list-group:first-child .list-group-item:first-child,
5106
+ .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
5107
  border-top: 0;
5108
  border-top-left-radius: 3px;
5109
  border-top-right-radius: 3px;
5110
  }
5111
+ .panel > .list-group:last-child .list-group-item:last-child,
5112
+ .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
5113
  border-bottom: 0;
5114
  border-bottom-right-radius: 3px;
5115
  border-bottom-left-radius: 3px;
5125
  .panel > .panel-collapse > .table {
5126
  margin-bottom: 0;
5127
  }
5128
+ .panel > .table caption,
5129
+ .panel > .table-responsive > .table caption,
5130
+ .panel > .panel-collapse > .table caption {
5131
+ padding-right: 15px;
5132
+ padding-left: 15px;
5133
+ }
5134
  .panel > .table:first-child,
5135
  .panel > .table-responsive:first-child > .table:first-child {
5136
  border-top-left-radius: 3px;
5137
  border-top-right-radius: 3px;
5138
  }
5139
+ .panel > .table:first-child > thead:first-child > tr:first-child,
5140
+ .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
5141
+ .panel > .table:first-child > tbody:first-child > tr:first-child,
5142
+ .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
5143
+ border-top-left-radius: 3px;
5144
+ border-top-right-radius: 3px;
5145
+ }
5146
  .panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
5147
  .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
5148
  .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
5168
  border-bottom-right-radius: 3px;
5169
  border-bottom-left-radius: 3px;
5170
  }
5171
+ .panel > .table:last-child > tbody:last-child > tr:last-child,
5172
+ .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
5173
+ .panel > .table:last-child > tfoot:last-child > tr:last-child,
5174
+ .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
5175
+ border-bottom-right-radius: 3px;
5176
+ border-bottom-left-radius: 3px;
5177
+ }
5178
  .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
5179
  .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
5180
  .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
5196
  border-bottom-right-radius: 3px;
5197
  }
5198
  .panel > .panel-body + .table,
5199
+ .panel > .panel-body + .table-responsive,
5200
+ .panel > .table + .panel-body,
5201
+ .panel > .table-responsive + .panel-body {
5202
  border-top: 1px solid #ddd;
5203
  }
5204
  .panel > .table > tbody:first-child > tr:first-child th,
5274
  .panel-group .panel-heading {
5275
  border-bottom: 0;
5276
  }
5277
+ .panel-group .panel-heading + .panel-collapse > .panel-body,
5278
+ .panel-group .panel-heading + .panel-collapse > .list-group {
5279
  border-top: 1px solid #ddd;
5280
  }
5281
  .panel-group .panel-footer {
5303
  border-bottom-color: #ddd;
5304
  }
5305
  .panel-primary {
5306
+ border-color: #337ab7;
5307
  }
5308
  .panel-primary > .panel-heading {
5309
  color: #fff;
5310
+ background-color: #337ab7;
5311
+ border-color: #337ab7;
5312
  }
5313
  .panel-primary > .panel-heading + .panel-collapse > .panel-body {
5314
+ border-top-color: #337ab7;
5315
  }
5316
  .panel-primary > .panel-heading .badge {
5317
+ color: #337ab7;
5318
  background-color: #fff;
5319
  }
5320
  .panel-primary > .panel-footer + .panel-collapse > .panel-body {
5321
+ border-bottom-color: #337ab7;
5322
  }
5323
  .panel-success {
5324
  border-color: #d6e9c6;
5402
  .embed-responsive .embed-responsive-item,
5403
  .embed-responsive iframe,
5404
  .embed-responsive embed,
5405
+ .embed-responsive object,
5406
+ .embed-responsive video {
5407
  position: absolute;
5408
  top: 0;
5409
  bottom: 0;
5474
  right: 0;
5475
  bottom: 0;
5476
  left: 0;
5477
+ z-index: 1040;
5478
  display: none;
5479
  overflow: hidden;
5480
  -webkit-overflow-scrolling: touch;
5484
  -webkit-transition: -webkit-transform .3s ease-out;
5485
  -o-transition: -o-transform .3s ease-out;
5486
  transition: transform .3s ease-out;
5487
+ -webkit-transform: translate(0, -25%);
5488
+ -ms-transform: translate(0, -25%);
5489
+ -o-transform: translate(0, -25%);
5490
+ transform: translate(0, -25%);
5491
  }
5492
  .modal.in .modal-dialog {
5493
+ -webkit-transform: translate(0, 0);
5494
+ -ms-transform: translate(0, 0);
5495
+ -o-transform: translate(0, 0);
5496
+ transform: translate(0, 0);
5497
  }
5498
  .modal-open .modal {
5499
  overflow-x: hidden;
5517
  box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
5518
  }
5519
  .modal-backdrop {
5520
+ position: absolute;
5521
  top: 0;
5522
  right: 0;
 
5523
  left: 0;
 
5524
  background-color: #000;
5525
  }
5526
  .modal-backdrop.fade {
5591
  position: absolute;
5592
  z-index: 1070;
5593
  display: block;
5594
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
5595
  font-size: 12px;
5596
+ font-weight: normal;
5597
  line-height: 1.4;
5598
  visibility: visible;
5599
  filter: alpha(opacity=0);
5643
  border-top-color: #000;
5644
  }
5645
  .tooltip.top-left .tooltip-arrow {
5646
+ right: 5px;
5647
  bottom: 0;
5648
+ margin-bottom: -5px;
5649
  border-width: 5px 5px 0;
5650
  border-top-color: #000;
5651
  }
5652
  .tooltip.top-right .tooltip-arrow {
 
5653
  bottom: 0;
5654
+ left: 5px;
5655
+ margin-bottom: -5px;
5656
  border-width: 5px 5px 0;
5657
  border-top-color: #000;
5658
  }
5679
  }
5680
  .tooltip.bottom-left .tooltip-arrow {
5681
  top: 0;
5682
+ right: 5px;
5683
+ margin-top: -5px;
5684
  border-width: 0 5px 5px;
5685
  border-bottom-color: #000;
5686
  }
5687
  .tooltip.bottom-right .tooltip-arrow {
5688
  top: 0;
5689
+ left: 5px;
5690
+ margin-top: -5px;
5691
  border-width: 0 5px 5px;
5692
  border-bottom-color: #000;
5693
  }
5699
  display: none;
5700
  max-width: 276px;
5701
  padding: 1px;
5702
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
5703
+ font-size: 14px;
5704
+ font-weight: normal;
5705
+ line-height: 1.42857143;
5706
  text-align: left;
5707
  white-space: normal;
5708
  background-color: #fff;
5730
  padding: 8px 14px;
5731
  margin: 0;
5732
  font-size: 14px;
 
 
5733
  background-color: #f7f7f7;
5734
  border-bottom: 1px solid #ebebeb;
5735
  border-radius: 5px 5px 0 0;
5832
  .carousel-inner > .item > a > img {
5833
  line-height: 1;
5834
  }
5835
+ @media all and (transform-3d), (-webkit-transform-3d) {
5836
+ .carousel-inner > .item {
5837
+ -webkit-transition: -webkit-transform .6s ease-in-out;
5838
+ -o-transition: -o-transform .6s ease-in-out;
5839
+ transition: transform .6s ease-in-out;
5840
+
5841
+ -webkit-backface-visibility: hidden;
5842
+ backface-visibility: hidden;
5843
+ -webkit-perspective: 1000;
5844
+ perspective: 1000;
5845
+ }
5846
+ .carousel-inner > .item.next,
5847
+ .carousel-inner > .item.active.right {
5848
+ left: 0;
5849
+ -webkit-transform: translate3d(100%, 0, 0);
5850
+ transform: translate3d(100%, 0, 0);
5851
+ }
5852
+ .carousel-inner > .item.prev,
5853
+ .carousel-inner > .item.active.left {
5854
+ left: 0;
5855
+ -webkit-transform: translate3d(-100%, 0, 0);
5856
+ transform: translate3d(-100%, 0, 0);
5857
+ }
5858
+ .carousel-inner > .item.next.left,
5859
+ .carousel-inner > .item.prev.right,
5860
+ .carousel-inner > .item.active {
5861
+ left: 0;
5862
+ -webkit-transform: translate3d(0, 0, 0);
5863
+ transform: translate3d(0, 0, 0);
5864
+ }
5865
+ }
5866
  .carousel-inner > .active,
5867
  .carousel-inner > .next,
5868
  .carousel-inner > .prev {
6118
  }
6119
  .affix {
6120
  position: fixed;
 
 
 
6121
  }
6122
  @-ms-viewport {
6123
  width: device-width;
assets/bootstrap/css/bootstrap.min.css CHANGED
@@ -1,7 +1,7 @@
1
  /*!
2
- * Bootstrap v3.2.0 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  *!!!!! deleted: html,body
6
  *!!!!! modified: .hidden
7
- *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;width:100% \9;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#777;opacity:1}.form-control:-ms-input-placeholder{color:#777}.form-control::-webkit-input-placeholder{color:#777}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:20px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-horizontal .form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:25px;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{position:absolute;z-index:-1;filter:alpha(opacity=0);opacity:0}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a{color:#777}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{min-width:30px;color:#777;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate3d(0,-25%,0);-o-transform:translate3d(0,-25%,0);transform:translate3d(0,-25%,0)}.modal.in .modal-dialog{-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none}.affix{position:fixed;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
1
  /*!
2
+ * Bootstrap v3.3.1 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  *!!!!! deleted: html,body
6
  *!!!!! modified: .hidden
7
+ *//*! normalize.css v3.0.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:before,:after{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm,select.form-group-sm .form-control{height:30px;line-height:30px}textarea.input-sm,textarea.form-group-sm .form-control,select[multiple].input-sm,select[multiple].form-group-sm .form-control{height:auto}.input-lg,.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg,select.form-group-lg .form-control{height:46px;line-height:46px}textarea.input-lg,textarea.form-group-lg .form-control,select[multiple].input-lg,select[multiple].form-group-lg .form-control{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default.focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:hover,.btn-primary:focus,.btn-primary.focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success.focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info.focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning.focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger.focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none;visibility:hidden}.collapse.in{display:block;visibility:visible}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=radio],[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none;visibility:hidden}.tab-content>.active{display:block;visibility:visible}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important;visibility:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-right:15px;padding-left:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:absolute;top:0;right:0;left:0;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.next,.carousel-inner>.item.active.right{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
assets/bootstrap/js/bootstrap.js CHANGED
@@ -1,13 +1,22 @@
1
  /*!
2
- * Bootstrap v3.2.0 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
 
7
- if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
 
 
 
 
 
 
 
 
 
8
 
9
  /* ========================================================================
10
- * Bootstrap: transition.js v3.2.0
11
  * http://getbootstrap.com/javascript/#transitions
12
  * ========================================================================
13
  * Copyright 2011-2014 Twitter, Inc.
@@ -67,7 +76,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
67
  }(jQuery);
68
 
69
  /* ========================================================================
70
- * Bootstrap: alert.js v3.2.0
71
  * http://getbootstrap.com/javascript/#alerts
72
  * ========================================================================
73
  * Copyright 2011-2014 Twitter, Inc.
@@ -86,7 +95,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
86
  $(el).on('click', dismiss, this.close)
87
  }
88
 
89
- Alert.VERSION = '3.2.0'
 
 
90
 
91
  Alert.prototype.close = function (e) {
92
  var $this = $(this)
@@ -102,7 +113,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
102
  if (e) e.preventDefault()
103
 
104
  if (!$parent.length) {
105
- $parent = $this.hasClass('alert') ? $this : $this.parent()
106
  }
107
 
108
  $parent.trigger(e = $.Event('close.bs.alert'))
@@ -119,7 +130,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
119
  $.support.transition && $parent.hasClass('fade') ?
120
  $parent
121
  .one('bsTransitionEnd', removeElement)
122
- .emulateTransitionEnd(150) :
123
  removeElement()
124
  }
125
 
@@ -160,7 +171,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
160
  }(jQuery);
161
 
162
  /* ========================================================================
163
- * Bootstrap: button.js v3.2.0
164
  * http://getbootstrap.com/javascript/#buttons
165
  * ========================================================================
166
  * Copyright 2011-2014 Twitter, Inc.
@@ -180,7 +191,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
180
  this.isLoading = false
181
  }
182
 
183
- Button.VERSION = '3.2.0'
184
 
185
  Button.DEFAULTS = {
186
  loadingText: 'loading...'
@@ -196,10 +207,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
196
 
197
  if (data.resetText == null) $el.data('resetText', $el[val]())
198
 
199
- $el[val](data[state] == null ? this.options[state] : data[state])
200
-
201
  // push to event loop to allow forms to submit
202
  setTimeout($.proxy(function () {
 
 
203
  if (state == 'loadingText') {
204
  this.isLoading = true
205
  $el.addClass(d).attr(d, d)
@@ -221,6 +232,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
221
  else $parent.find('.active').removeClass('active')
222
  }
223
  if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
 
 
224
  }
225
 
226
  if (changed) this.$element.toggleClass('active')
@@ -261,17 +274,21 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
261
  // BUTTON DATA-API
262
  // ===============
263
 
264
- $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
265
- var $btn = $(e.target)
266
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
267
- Plugin.call($btn, 'toggle')
268
- e.preventDefault()
269
- })
 
 
 
 
270
 
271
  }(jQuery);
272
 
273
  /* ========================================================================
274
- * Bootstrap: carousel.js v3.2.0
275
  * http://getbootstrap.com/javascript/#carousel
276
  * ========================================================================
277
  * Copyright 2011-2014 Twitter, Inc.
@@ -286,7 +303,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
286
  // =========================
287
 
288
  var Carousel = function (element, options) {
289
- this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
290
  this.$indicators = this.$element.find('.carousel-indicators')
291
  this.options = options
292
  this.paused =
@@ -295,20 +312,26 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
295
  this.$active =
296
  this.$items = null
297
 
298
- this.options.pause == 'hover' && this.$element
 
 
299
  .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
300
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
301
  }
302
 
303
- Carousel.VERSION = '3.2.0'
 
 
304
 
305
  Carousel.DEFAULTS = {
306
  interval: 5000,
307
  pause: 'hover',
308
- wrap: true
 
309
  }
310
 
311
  Carousel.prototype.keydown = function (e) {
 
312
  switch (e.which) {
313
  case 37: this.prev(); break
314
  case 39: this.next(); break
@@ -335,6 +358,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
335
  return this.$items.index(item || this.$active)
336
  }
337
 
 
 
 
 
 
 
 
338
  Carousel.prototype.to = function (pos) {
339
  var that = this
340
  var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
@@ -344,7 +374,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
344
  if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
345
  if (activeIndex == pos) return this.pause().cycle()
346
 
347
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
348
  }
349
 
350
  Carousel.prototype.pause = function (e) {
@@ -372,7 +402,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
372
 
373
  Carousel.prototype.slide = function (type, next) {
374
  var $active = this.$element.find('.item.active')
375
- var $next = next || $active[type]()
376
  var isCycling = this.interval
377
  var direction = type == 'next' ? 'left' : 'right'
378
  var fallback = type == 'next' ? 'first' : 'last'
@@ -418,7 +448,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
418
  that.$element.trigger(slidEvent)
419
  }, 0)
420
  })
421
- .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
422
  } else {
423
  $active.removeClass('active')
424
  $next.addClass('active')
@@ -467,7 +497,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
467
  // CAROUSEL DATA-API
468
  // =================
469
 
470
- $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
471
  var href
472
  var $this = $(this)
473
  var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
@@ -483,7 +513,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
483
  }
484
 
485
  e.preventDefault()
486
- })
 
 
 
 
487
 
488
  $(window).on('load', function () {
489
  $('[data-ride="carousel"]').each(function () {
@@ -495,7 +529,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
495
  }(jQuery);
496
 
497
  /* ========================================================================
498
- * Bootstrap: collapse.js v3.2.0
499
  * http://getbootstrap.com/javascript/#collapse
500
  * ========================================================================
501
  * Copyright 2011-2014 Twitter, Inc.
@@ -512,16 +546,25 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
512
  var Collapse = function (element, options) {
513
  this.$element = $(element)
514
  this.options = $.extend({}, Collapse.DEFAULTS, options)
 
515
  this.transitioning = null
516
 
517
- if (this.options.parent) this.$parent = $(this.options.parent)
 
 
 
 
 
518
  if (this.options.toggle) this.toggle()
519
  }
520
 
521
- Collapse.VERSION = '3.2.0'
 
 
522
 
523
  Collapse.DEFAULTS = {
524
- toggle: true
 
525
  }
526
 
527
  Collapse.prototype.dimension = function () {
@@ -532,17 +575,21 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
532
  Collapse.prototype.show = function () {
533
  if (this.transitioning || this.$element.hasClass('in')) return
534
 
 
 
 
 
 
 
 
 
535
  var startEvent = $.Event('show.bs.collapse')
536
  this.$element.trigger(startEvent)
537
  if (startEvent.isDefaultPrevented()) return
538
 
539
- var actives = this.$parent && this.$parent.find('> .panel > .in')
540
-
541
  if (actives && actives.length) {
542
- var hasData = actives.data('bs.collapse')
543
- if (hasData && hasData.transitioning) return
544
  Plugin.call(actives, 'hide')
545
- hasData || actives.data('bs.collapse', null)
546
  }
547
 
548
  var dimension = this.dimension()
@@ -550,6 +597,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
550
  this.$element
551
  .removeClass('collapse')
552
  .addClass('collapsing')[dimension](0)
 
 
 
 
 
553
 
554
  this.transitioning = 1
555
 
@@ -568,7 +620,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
568
 
569
  this.$element
570
  .one('bsTransitionEnd', $.proxy(complete, this))
571
- .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
572
  }
573
 
574
  Collapse.prototype.hide = function () {
@@ -584,17 +636,21 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
584
 
585
  this.$element
586
  .addClass('collapsing')
587
- .removeClass('collapse')
588
- .removeClass('in')
 
 
 
 
589
 
590
  this.transitioning = 1
591
 
592
  var complete = function () {
593
  this.transitioning = 0
594
  this.$element
595
- .trigger('hidden.bs.collapse')
596
  .removeClass('collapsing')
597
  .addClass('collapse')
 
598
  }
599
 
600
  if (!$.support.transition) return complete.call(this)
@@ -602,13 +658,40 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
602
  this.$element
603
  [dimension](0)
604
  .one('bsTransitionEnd', $.proxy(complete, this))
605
- .emulateTransitionEnd(350)
606
  }
607
 
608
  Collapse.prototype.toggle = function () {
609
  this[this.$element.hasClass('in') ? 'hide' : 'show']()
610
  }
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
 
613
  // COLLAPSE PLUGIN DEFINITION
614
  // ==========================
@@ -619,7 +702,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
619
  var data = $this.data('bs.collapse')
620
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
621
 
622
- if (!data && options.toggle && option == 'show') option = !option
623
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
624
  if (typeof option == 'string') data[option]()
625
  })
@@ -644,21 +727,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
644
  // =================
645
 
646
  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
647
- var href
648
  var $this = $(this)
649
- var target = $this.attr('data-target')
650
- || e.preventDefault()
651
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
652
- var $target = $(target)
653
- var data = $target.data('bs.collapse')
654
- var option = data ? 'toggle' : $this.data()
655
- var parent = $this.attr('data-parent')
656
- var $parent = parent && $(parent)
657
 
658
- if (!data || !data.transitioning) {
659
- if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
660
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
661
- }
 
662
 
663
  Plugin.call($target, option)
664
  })
@@ -666,7 +741,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
666
  }(jQuery);
667
 
668
  /* ========================================================================
669
- * Bootstrap: dropdown.js v3.2.0
670
  * http://getbootstrap.com/javascript/#dropdowns
671
  * ========================================================================
672
  * Copyright 2011-2014 Twitter, Inc.
@@ -686,7 +761,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
686
  $(element).on('click.bs.dropdown', this.toggle)
687
  }
688
 
689
- Dropdown.VERSION = '3.2.0'
690
 
691
  Dropdown.prototype.toggle = function (e) {
692
  var $this = $(this)
@@ -709,7 +784,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
709
 
710
  if (e.isDefaultPrevented()) return
711
 
712
- $this.trigger('focus')
 
 
713
 
714
  $parent
715
  .toggleClass('open')
@@ -720,7 +797,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
720
  }
721
 
722
  Dropdown.prototype.keydown = function (e) {
723
- if (!/(38|40|27)/.test(e.keyCode)) return
724
 
725
  var $this = $(this)
726
 
@@ -732,7 +809,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
732
  var $parent = getParent($this)
733
  var isActive = $parent.hasClass('open')
734
 
735
- if (!isActive || (isActive && e.keyCode == 27)) {
736
  if (e.which == 27) $parent.find(toggle).trigger('focus')
737
  return $this.trigger('click')
738
  }
@@ -742,10 +819,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
742
 
743
  if (!$items.length) return
744
 
745
- var index = $items.index($items.filter(':focus'))
746
 
747
- if (e.keyCode == 38 && index > 0) index-- // up
748
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
749
  if (!~index) index = 0
750
 
751
  $items.eq(index).trigger('focus')
@@ -755,11 +832,17 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
755
  if (e && e.which === 3) return
756
  $(backdrop).remove()
757
  $(toggle).each(function () {
758
- var $parent = getParent($(this))
 
759
  var relatedTarget = { relatedTarget: this }
 
760
  if (!$parent.hasClass('open')) return
 
761
  $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
 
762
  if (e.isDefaultPrevented()) return
 
 
763
  $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
764
  })
765
  }
@@ -813,12 +896,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
813
  .on('click.bs.dropdown.data-api', clearMenus)
814
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
815
  .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
816
- .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
 
 
817
 
818
  }(jQuery);
819
 
820
  /* ========================================================================
821
- * Bootstrap: modal.js v3.2.0
822
  * http://getbootstrap.com/javascript/#modals
823
  * ========================================================================
824
  * Copyright 2011-2014 Twitter, Inc.
@@ -849,7 +934,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
849
  }
850
  }
851
 
852
- Modal.VERSION = '3.2.0'
 
 
 
853
 
854
  Modal.DEFAULTS = {
855
  backdrop: true,
@@ -872,10 +960,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
872
  this.isShown = true
873
 
874
  this.checkScrollbar()
 
875
  this.$body.addClass('modal-open')
876
 
877
- this.setScrollbar()
878
  this.escape()
 
879
 
880
  this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
881
 
@@ -890,6 +979,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
890
  .show()
891
  .scrollTop(0)
892
 
 
 
 
893
  if (transition) {
894
  that.$element[0].offsetWidth // force reflow
895
  }
@@ -907,7 +999,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
907
  .one('bsTransitionEnd', function () {
908
  that.$element.trigger('focus').trigger(e)
909
  })
910
- .emulateTransitionEnd(300) :
911
  that.$element.trigger('focus').trigger(e)
912
  })
913
  }
@@ -923,10 +1015,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
923
 
924
  this.isShown = false
925
 
926
- this.$body.removeClass('modal-open')
927
-
928
- this.resetScrollbar()
929
  this.escape()
 
930
 
931
  $(document).off('focusin.bs.modal')
932
 
@@ -938,7 +1028,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
938
  $.support.transition && this.$element.hasClass('fade') ?
939
  this.$element
940
  .one('bsTransitionEnd', $.proxy(this.hideModal, this))
941
- .emulateTransitionEnd(300) :
942
  this.hideModal()
943
  }
944
 
@@ -954,11 +1044,19 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
954
 
955
  Modal.prototype.escape = function () {
956
  if (this.isShown && this.options.keyboard) {
957
- this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
958
  e.which == 27 && this.hide()
959
  }, this))
960
  } else if (!this.isShown) {
961
- this.$element.off('keyup.dismiss.bs.modal')
 
 
 
 
 
 
 
 
962
  }
963
  }
964
 
@@ -966,6 +1064,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
966
  var that = this
967
  this.$element.hide()
968
  this.backdrop(function () {
 
 
 
969
  that.$element.trigger('hidden.bs.modal')
970
  })
971
  }
@@ -983,14 +1084,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
983
  var doAnimate = $.support.transition && animate
984
 
985
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
986
- .appendTo(this.$body)
987
-
988
- this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
989
- if (e.target !== e.currentTarget) return
990
- this.options.backdrop == 'static'
991
- ? this.$element[0].focus.call(this.$element[0])
992
- : this.hide.call(this)
993
- }, this))
994
 
995
  if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
996
 
@@ -1001,7 +1101,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1001
  doAnimate ?
1002
  this.$backdrop
1003
  .one('bsTransitionEnd', callback)
1004
- .emulateTransitionEnd(150) :
1005
  callback()
1006
 
1007
  } else if (!this.isShown && this.$backdrop) {
@@ -1014,7 +1114,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1014
  $.support.transition && this.$element.hasClass('fade') ?
1015
  this.$backdrop
1016
  .one('bsTransitionEnd', callbackRemove)
1017
- .emulateTransitionEnd(150) :
1018
  callbackRemove()
1019
 
1020
  } else if (callback) {
@@ -1022,14 +1122,43 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1022
  }
1023
  }
1024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
  Modal.prototype.checkScrollbar = function () {
1026
- if (document.body.clientWidth >= window.innerWidth) return
1027
- this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
1028
  }
1029
 
1030
  Modal.prototype.setScrollbar = function () {
1031
  var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1032
- if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1033
  }
1034
 
1035
  Modal.prototype.resetScrollbar = function () {
@@ -1099,7 +1228,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1099
  }(jQuery);
1100
 
1101
  /* ========================================================================
1102
- * Bootstrap: tooltip.js v3.2.0
1103
  * http://getbootstrap.com/javascript/#tooltip
1104
  * Inspired by the original jQuery.tipsy by Jason Frame
1105
  * ========================================================================
@@ -1125,7 +1254,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1125
  this.init('tooltip', element, options)
1126
  }
1127
 
1128
- Tooltip.VERSION = '3.2.0'
 
 
1129
 
1130
  Tooltip.DEFAULTS = {
1131
  animation: true,
@@ -1203,6 +1334,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1203
  var self = obj instanceof this.constructor ?
1204
  obj : $(obj.currentTarget).data('bs.' + this.type)
1205
 
 
 
 
 
 
1206
  if (!self) {
1207
  self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1208
  $(obj.currentTarget).data('bs.' + this.type, self)
@@ -1245,7 +1381,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1245
  if (this.hasContent() && this.enabled) {
1246
  this.$element.trigger(e)
1247
 
1248
- var inDom = $.contains(document.documentElement, this.$element[0])
1249
  if (e.isDefaultPrevented() || !inDom) return
1250
  var that = this
1251
 
@@ -1281,13 +1417,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1281
 
1282
  if (autoPlace) {
1283
  var orgPlacement = placement
1284
- var $parent = this.$element.parent()
1285
- var parentDim = this.getPosition($parent)
1286
 
1287
- placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
1288
- placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
1289
- placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
1290
- placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
1291
  placement
1292
 
1293
  $tip
@@ -1300,14 +1436,17 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1300
  this.applyPlacement(calculatedOffset, placement)
1301
 
1302
  var complete = function () {
 
1303
  that.$element.trigger('shown.bs.' + that.type)
1304
  that.hoverState = null
 
 
1305
  }
1306
 
1307
  $.support.transition && this.$tip.hasClass('fade') ?
1308
  $tip
1309
  .one('bsTransitionEnd', complete)
1310
- .emulateTransitionEnd(150) :
1311
  complete()
1312
  }
1313
  }
@@ -1354,16 +1493,18 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1354
  if (delta.left) offset.left += delta.left
1355
  else offset.top += delta.top
1356
 
1357
- var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1358
- var arrowPosition = delta.left ? 'left' : 'top'
1359
- var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
1360
 
1361
  $tip.offset(offset)
1362
- this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
1363
  }
1364
 
1365
- Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
1366
- this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
 
 
1367
  }
1368
 
1369
  Tooltip.prototype.setContent = function () {
@@ -1374,16 +1515,17 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1374
  $tip.removeClass('fade in top bottom left right')
1375
  }
1376
 
1377
- Tooltip.prototype.hide = function () {
1378
  var that = this
1379
  var $tip = this.tip()
1380
  var e = $.Event('hide.bs.' + this.type)
1381
 
1382
- this.$element.removeAttr('aria-describedby')
1383
-
1384
  function complete() {
1385
  if (that.hoverState != 'in') $tip.detach()
1386
- that.$element.trigger('hidden.bs.' + that.type)
 
 
 
1387
  }
1388
 
1389
  this.$element.trigger(e)
@@ -1395,7 +1537,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1395
  $.support.transition && this.$tip.hasClass('fade') ?
1396
  $tip
1397
  .one('bsTransitionEnd', complete)
1398
- .emulateTransitionEnd(150) :
1399
  complete()
1400
 
1401
  this.hoverState = null
@@ -1416,13 +1558,20 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1416
 
1417
  Tooltip.prototype.getPosition = function ($element) {
1418
  $element = $element || this.$element
 
1419
  var el = $element[0]
1420
  var isBody = el.tagName == 'BODY'
1421
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
1422
- scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
1423
- width: isBody ? $(window).width() : $element.outerWidth(),
1424
- height: isBody ? $(window).height() : $element.outerHeight()
1425
- }, isBody ? { top: 0, left: 0 } : $element.offset())
 
 
 
 
 
 
1426
  }
1427
 
1428
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -1486,14 +1635,6 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1486
  return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1487
  }
1488
 
1489
- Tooltip.prototype.validate = function () {
1490
- if (!this.$element[0].parentNode) {
1491
- this.hide()
1492
- this.$element = null
1493
- this.options = null
1494
- }
1495
- }
1496
-
1497
  Tooltip.prototype.enable = function () {
1498
  this.enabled = true
1499
  }
@@ -1520,8 +1661,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1520
  }
1521
 
1522
  Tooltip.prototype.destroy = function () {
 
1523
  clearTimeout(this.timeout)
1524
- this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
 
 
1525
  }
1526
 
1527
 
@@ -1530,12 +1674,18 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1530
 
1531
  function Plugin(option) {
1532
  return this.each(function () {
1533
- var $this = $(this)
1534
- var data = $this.data('bs.tooltip')
1535
- var options = typeof option == 'object' && option
 
1536
 
1537
  if (!data && option == 'destroy') return
1538
- if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
 
 
 
 
 
1539
  if (typeof option == 'string') data[option]()
1540
  })
1541
  }
@@ -1557,7 +1707,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1557
  }(jQuery);
1558
 
1559
  /* ========================================================================
1560
- * Bootstrap: popover.js v3.2.0
1561
  * http://getbootstrap.com/javascript/#popovers
1562
  * ========================================================================
1563
  * Copyright 2011-2014 Twitter, Inc.
@@ -1577,7 +1727,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1577
 
1578
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1579
 
1580
- Popover.VERSION = '3.2.0'
1581
 
1582
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1583
  placement: 'right',
@@ -1604,7 +1754,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1604
  var content = this.getContent()
1605
 
1606
  $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1607
- $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
1608
  this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1609
  ](content)
1610
 
@@ -1644,12 +1794,18 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1644
 
1645
  function Plugin(option) {
1646
  return this.each(function () {
1647
- var $this = $(this)
1648
- var data = $this.data('bs.popover')
1649
- var options = typeof option == 'object' && option
 
1650
 
1651
  if (!data && option == 'destroy') return
1652
- if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
 
 
 
 
 
1653
  if (typeof option == 'string') data[option]()
1654
  })
1655
  }
@@ -1671,7 +1827,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1671
  }(jQuery);
1672
 
1673
  /* ========================================================================
1674
- * Bootstrap: scrollspy.js v3.2.0
1675
  * http://getbootstrap.com/javascript/#scrollspy
1676
  * ========================================================================
1677
  * Copyright 2011-2014 Twitter, Inc.
@@ -1702,7 +1858,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1702
  this.process()
1703
  }
1704
 
1705
- ScrollSpy.VERSION = '3.2.0'
1706
 
1707
  ScrollSpy.DEFAULTS = {
1708
  offset: 10
@@ -1763,8 +1919,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1763
  return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1764
  }
1765
 
1766
- if (activeTarget && scrollTop <= offsets[0]) {
1767
- return activeTarget != (i = targets[0]) && this.activate(i)
 
1768
  }
1769
 
1770
  for (i = offsets.length; i--;) {
@@ -1778,9 +1935,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1778
  ScrollSpy.prototype.activate = function (target) {
1779
  this.activeTarget = target
1780
 
1781
- $(this.selector)
1782
- .parentsUntil(this.options.target, '.active')
1783
- .removeClass('active')
1784
 
1785
  var selector = this.selector +
1786
  '[data-target="' + target + '"],' +
@@ -1799,6 +1954,12 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1799
  active.trigger('activate.bs.scrollspy')
1800
  }
1801
 
 
 
 
 
 
 
1802
 
1803
  // SCROLLSPY PLUGIN DEFINITION
1804
  // ===========================
@@ -1842,7 +2003,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1842
  }(jQuery);
1843
 
1844
  /* ========================================================================
1845
- * Bootstrap: tab.js v3.2.0
1846
  * http://getbootstrap.com/javascript/#tabs
1847
  * ========================================================================
1848
  * Copyright 2011-2014 Twitter, Inc.
@@ -1860,7 +2021,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1860
  this.element = $(element)
1861
  }
1862
 
1863
- Tab.VERSION = '3.2.0'
 
 
1864
 
1865
  Tab.prototype.show = function () {
1866
  var $this = this.element
@@ -1874,22 +2037,30 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1874
 
1875
  if ($this.parent('li').hasClass('active')) return
1876
 
1877
- var previous = $ul.find('.active:last a')[0]
1878
- var e = $.Event('show.bs.tab', {
1879
- relatedTarget: previous
 
 
 
1880
  })
1881
 
1882
- $this.trigger(e)
 
1883
 
1884
- if (e.isDefaultPrevented()) return
1885
 
1886
  var $target = $(selector)
1887
 
1888
  this.activate($this.closest('li'), $ul)
1889
  this.activate($target, $target.parent(), function () {
 
 
 
 
1890
  $this.trigger({
1891
  type: 'shown.bs.tab',
1892
- relatedTarget: previous
1893
  })
1894
  })
1895
  }
@@ -1898,15 +2069,21 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1898
  var $active = container.find('> .active')
1899
  var transition = callback
1900
  && $.support.transition
1901
- && $active.hasClass('fade')
1902
 
1903
  function next() {
1904
  $active
1905
  .removeClass('active')
1906
  .find('> .dropdown-menu > .active')
1907
- .removeClass('active')
 
 
 
1908
 
1909
- element.addClass('active')
 
 
 
1910
 
1911
  if (transition) {
1912
  element[0].offsetWidth // reflow for transition
@@ -1916,16 +2093,21 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1916
  }
1917
 
1918
  if (element.parent('.dropdown-menu')) {
1919
- element.closest('li.dropdown').addClass('active')
 
 
 
 
 
1920
  }
1921
 
1922
  callback && callback()
1923
  }
1924
 
1925
- transition ?
1926
  $active
1927
  .one('bsTransitionEnd', next)
1928
- .emulateTransitionEnd(150) :
1929
  next()
1930
 
1931
  $active.removeClass('in')
@@ -1963,15 +2145,19 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
1963
  // TAB DATA-API
1964
  // ============
1965
 
1966
- $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1967
  e.preventDefault()
1968
  Plugin.call($(this), 'show')
1969
- })
 
 
 
 
1970
 
1971
  }(jQuery);
1972
 
1973
  /* ========================================================================
1974
- * Bootstrap: affix.js v3.2.0
1975
  * http://getbootstrap.com/javascript/#affix
1976
  * ========================================================================
1977
  * Copyright 2011-2014 Twitter, Inc.
@@ -2000,7 +2186,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
2000
  this.checkPosition()
2001
  }
2002
 
2003
- Affix.VERSION = '3.2.0'
2004
 
2005
  Affix.RESET = 'affix affix-top affix-bottom'
2006
 
@@ -2009,6 +2195,28 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
2009
  target: window
2010
  }
2011
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2012
  Affix.prototype.getPinnedOffset = function () {
2013
  if (this.pinnedOffset) return this.pinnedOffset
2014
  this.$element.removeClass(Affix.RESET).addClass('affix')
@@ -2024,42 +2232,40 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
2024
  Affix.prototype.checkPosition = function () {
2025
  if (!this.$element.is(':visible')) return
2026
 
2027
- var scrollHeight = $(document).height()
2028
- var scrollTop = this.$target.scrollTop()
2029
- var position = this.$element.offset()
2030
  var offset = this.options.offset
2031
  var offsetTop = offset.top
2032
  var offsetBottom = offset.bottom
 
2033
 
2034
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
2035
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
2036
  if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
2037
 
2038
- var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
2039
- offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
2040
- offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
2041
 
2042
- if (this.affixed === affix) return
2043
- if (this.unpin != null) this.$element.css('top', '')
2044
 
2045
- var affixType = 'affix' + (affix ? '-' + affix : '')
2046
- var e = $.Event(affixType + '.bs.affix')
2047
 
2048
- this.$element.trigger(e)
2049
 
2050
- if (e.isDefaultPrevented()) return
2051
 
2052
- this.affixed = affix
2053
- this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
2054
 
2055
- this.$element
2056
- .removeClass(Affix.RESET)
2057
- .addClass(affixType)
2058
- .trigger($.Event(affixType.replace('affix', 'affixed')))
 
2059
 
2060
  if (affix == 'bottom') {
2061
  this.$element.offset({
2062
- top: scrollHeight - this.$element.height() - offsetBottom
2063
  })
2064
  }
2065
  }
@@ -2104,8 +2310,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
2104
 
2105
  data.offset = data.offset || {}
2106
 
2107
- if (data.offsetBottom) data.offset.bottom = data.offsetBottom
2108
- if (data.offsetTop) data.offset.top = data.offsetTop
2109
 
2110
  Plugin.call($spy, data)
2111
  })
1
  /*!
2
+ * Bootstrap v3.3.1 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
 
7
+ if (typeof jQuery === 'undefined') {
8
+ throw new Error('Bootstrap\'s JavaScript requires jQuery')
9
+ }
10
+
11
+ +function ($) {
12
+ var version = $.fn.jquery.split(' ')[0].split('.')
13
+ if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
14
+ throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
15
+ }
16
+ }(jQuery);
17
 
18
  /* ========================================================================
19
+ * Bootstrap: transition.js v3.3.1
20
  * http://getbootstrap.com/javascript/#transitions
21
  * ========================================================================
22
  * Copyright 2011-2014 Twitter, Inc.
76
  }(jQuery);
77
 
78
  /* ========================================================================
79
+ * Bootstrap: alert.js v3.3.1
80
  * http://getbootstrap.com/javascript/#alerts
81
  * ========================================================================
82
  * Copyright 2011-2014 Twitter, Inc.
95
  $(el).on('click', dismiss, this.close)
96
  }
97
 
98
+ Alert.VERSION = '3.3.1'
99
+
100
+ Alert.TRANSITION_DURATION = 150
101
 
102
  Alert.prototype.close = function (e) {
103
  var $this = $(this)
113
  if (e) e.preventDefault()
114
 
115
  if (!$parent.length) {
116
+ $parent = $this.closest('.alert')
117
  }
118
 
119
  $parent.trigger(e = $.Event('close.bs.alert'))
130
  $.support.transition && $parent.hasClass('fade') ?
131
  $parent
132
  .one('bsTransitionEnd', removeElement)
133
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
134
  removeElement()
135
  }
136
 
171
  }(jQuery);
172
 
173
  /* ========================================================================
174
+ * Bootstrap: button.js v3.3.1
175
  * http://getbootstrap.com/javascript/#buttons
176
  * ========================================================================
177
  * Copyright 2011-2014 Twitter, Inc.
191
  this.isLoading = false
192
  }
193
 
194
+ Button.VERSION = '3.3.1'
195
 
196
  Button.DEFAULTS = {
197
  loadingText: 'loading...'
207
 
208
  if (data.resetText == null) $el.data('resetText', $el[val]())
209
 
 
 
210
  // push to event loop to allow forms to submit
211
  setTimeout($.proxy(function () {
212
+ $el[val](data[state] == null ? this.options[state] : data[state])
213
+
214
  if (state == 'loadingText') {
215
  this.isLoading = true
216
  $el.addClass(d).attr(d, d)
232
  else $parent.find('.active').removeClass('active')
233
  }
234
  if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
235
+ } else {
236
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
237
  }
238
 
239
  if (changed) this.$element.toggleClass('active')
274
  // BUTTON DATA-API
275
  // ===============
276
 
277
+ $(document)
278
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
279
+ var $btn = $(e.target)
280
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
281
+ Plugin.call($btn, 'toggle')
282
+ e.preventDefault()
283
+ })
284
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
285
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
286
+ })
287
 
288
  }(jQuery);
289
 
290
  /* ========================================================================
291
+ * Bootstrap: carousel.js v3.3.1
292
  * http://getbootstrap.com/javascript/#carousel
293
  * ========================================================================
294
  * Copyright 2011-2014 Twitter, Inc.
303
  // =========================
304
 
305
  var Carousel = function (element, options) {
306
+ this.$element = $(element)
307
  this.$indicators = this.$element.find('.carousel-indicators')
308
  this.options = options
309
  this.paused =
312
  this.$active =
313
  this.$items = null
314
 
315
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
316
+
317
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
318
  .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
319
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
320
  }
321
 
322
+ Carousel.VERSION = '3.3.1'
323
+
324
+ Carousel.TRANSITION_DURATION = 600
325
 
326
  Carousel.DEFAULTS = {
327
  interval: 5000,
328
  pause: 'hover',
329
+ wrap: true,
330
+ keyboard: true
331
  }
332
 
333
  Carousel.prototype.keydown = function (e) {
334
+ if (/input|textarea/i.test(e.target.tagName)) return
335
  switch (e.which) {
336
  case 37: this.prev(); break
337
  case 39: this.next(); break
358
  return this.$items.index(item || this.$active)
359
  }
360
 
361
+ Carousel.prototype.getItemForDirection = function (direction, active) {
362
+ var delta = direction == 'prev' ? -1 : 1
363
+ var activeIndex = this.getItemIndex(active)
364
+ var itemIndex = (activeIndex + delta) % this.$items.length
365
+ return this.$items.eq(itemIndex)
366
+ }
367
+
368
  Carousel.prototype.to = function (pos) {
369
  var that = this
370
  var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
374
  if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
375
  if (activeIndex == pos) return this.pause().cycle()
376
 
377
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
378
  }
379
 
380
  Carousel.prototype.pause = function (e) {
402
 
403
  Carousel.prototype.slide = function (type, next) {
404
  var $active = this.$element.find('.item.active')
405
+ var $next = next || this.getItemForDirection(type, $active)
406
  var isCycling = this.interval
407
  var direction = type == 'next' ? 'left' : 'right'
408
  var fallback = type == 'next' ? 'first' : 'last'
448
  that.$element.trigger(slidEvent)
449
  }, 0)
450
  })
451
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
452
  } else {
453
  $active.removeClass('active')
454
  $next.addClass('active')
497
  // CAROUSEL DATA-API
498
  // =================
499
 
500
+ var clickHandler = function (e) {
501
  var href
502
  var $this = $(this)
503
  var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
513
  }
514
 
515
  e.preventDefault()
516
+ }
517
+
518
+ $(document)
519
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
520
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
521
 
522
  $(window).on('load', function () {
523
  $('[data-ride="carousel"]').each(function () {
529
  }(jQuery);
530
 
531
  /* ========================================================================
532
+ * Bootstrap: collapse.js v3.3.1
533
  * http://getbootstrap.com/javascript/#collapse
534
  * ========================================================================
535
  * Copyright 2011-2014 Twitter, Inc.
546
  var Collapse = function (element, options) {
547
  this.$element = $(element)
548
  this.options = $.extend({}, Collapse.DEFAULTS, options)
549
+ this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
550
  this.transitioning = null
551
 
552
+ if (this.options.parent) {
553
+ this.$parent = this.getParent()
554
+ } else {
555
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
556
+ }
557
+
558
  if (this.options.toggle) this.toggle()
559
  }
560
 
561
+ Collapse.VERSION = '3.3.1'
562
+
563
+ Collapse.TRANSITION_DURATION = 350
564
 
565
  Collapse.DEFAULTS = {
566
+ toggle: true,
567
+ trigger: '[data-toggle="collapse"]'
568
  }
569
 
570
  Collapse.prototype.dimension = function () {
575
  Collapse.prototype.show = function () {
576
  if (this.transitioning || this.$element.hasClass('in')) return
577
 
578
+ var activesData
579
+ var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
580
+
581
+ if (actives && actives.length) {
582
+ activesData = actives.data('bs.collapse')
583
+ if (activesData && activesData.transitioning) return
584
+ }
585
+
586
  var startEvent = $.Event('show.bs.collapse')
587
  this.$element.trigger(startEvent)
588
  if (startEvent.isDefaultPrevented()) return
589
 
 
 
590
  if (actives && actives.length) {
 
 
591
  Plugin.call(actives, 'hide')
592
+ activesData || actives.data('bs.collapse', null)
593
  }
594
 
595
  var dimension = this.dimension()
597
  this.$element
598
  .removeClass('collapse')
599
  .addClass('collapsing')[dimension](0)
600
+ .attr('aria-expanded', true)
601
+
602
+ this.$trigger
603
+ .removeClass('collapsed')
604
+ .attr('aria-expanded', true)
605
 
606
  this.transitioning = 1
607
 
620
 
621
  this.$element
622
  .one('bsTransitionEnd', $.proxy(complete, this))
623
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
624
  }
625
 
626
  Collapse.prototype.hide = function () {
636
 
637
  this.$element
638
  .addClass('collapsing')
639
+ .removeClass('collapse in')
640
+ .attr('aria-expanded', false)
641
+
642
+ this.$trigger
643
+ .addClass('collapsed')
644
+ .attr('aria-expanded', false)
645
 
646
  this.transitioning = 1
647
 
648
  var complete = function () {
649
  this.transitioning = 0
650
  this.$element
 
651
  .removeClass('collapsing')
652
  .addClass('collapse')
653
+ .trigger('hidden.bs.collapse')
654
  }
655
 
656
  if (!$.support.transition) return complete.call(this)
658
  this.$element
659
  [dimension](0)
660
  .one('bsTransitionEnd', $.proxy(complete, this))
661
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
662
  }
663
 
664
  Collapse.prototype.toggle = function () {
665
  this[this.$element.hasClass('in') ? 'hide' : 'show']()
666
  }
667
 
668
+ Collapse.prototype.getParent = function () {
669
+ return $(this.options.parent)
670
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
671
+ .each($.proxy(function (i, element) {
672
+ var $element = $(element)
673
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
674
+ }, this))
675
+ .end()
676
+ }
677
+
678
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
679
+ var isOpen = $element.hasClass('in')
680
+
681
+ $element.attr('aria-expanded', isOpen)
682
+ $trigger
683
+ .toggleClass('collapsed', !isOpen)
684
+ .attr('aria-expanded', isOpen)
685
+ }
686
+
687
+ function getTargetFromTrigger($trigger) {
688
+ var href
689
+ var target = $trigger.attr('data-target')
690
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
691
+
692
+ return $(target)
693
+ }
694
+
695
 
696
  // COLLAPSE PLUGIN DEFINITION
697
  // ==========================
702
  var data = $this.data('bs.collapse')
703
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
704
 
705
+ if (!data && options.toggle && option == 'show') options.toggle = false
706
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
707
  if (typeof option == 'string') data[option]()
708
  })
727
  // =================
728
 
729
  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
 
730
  var $this = $(this)
 
 
 
 
 
 
 
 
731
 
732
+ if (!$this.attr('data-target')) e.preventDefault()
733
+
734
+ var $target = getTargetFromTrigger($this)
735
+ var data = $target.data('bs.collapse')
736
+ var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
737
 
738
  Plugin.call($target, option)
739
  })
741
  }(jQuery);
742
 
743
  /* ========================================================================
744
+ * Bootstrap: dropdown.js v3.3.1
745
  * http://getbootstrap.com/javascript/#dropdowns
746
  * ========================================================================
747
  * Copyright 2011-2014 Twitter, Inc.
761
  $(element).on('click.bs.dropdown', this.toggle)
762
  }
763
 
764
+ Dropdown.VERSION = '3.3.1'
765
 
766
  Dropdown.prototype.toggle = function (e) {
767
  var $this = $(this)
784
 
785
  if (e.isDefaultPrevented()) return
786
 
787
+ $this
788
+ .trigger('focus')
789
+ .attr('aria-expanded', 'true')
790
 
791
  $parent
792
  .toggleClass('open')
797
  }
798
 
799
  Dropdown.prototype.keydown = function (e) {
800
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
801
 
802
  var $this = $(this)
803
 
809
  var $parent = getParent($this)
810
  var isActive = $parent.hasClass('open')
811
 
812
+ if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
813
  if (e.which == 27) $parent.find(toggle).trigger('focus')
814
  return $this.trigger('click')
815
  }
819
 
820
  if (!$items.length) return
821
 
822
+ var index = $items.index(e.target)
823
 
824
+ if (e.which == 38 && index > 0) index-- // up
825
+ if (e.which == 40 && index < $items.length - 1) index++ // down
826
  if (!~index) index = 0
827
 
828
  $items.eq(index).trigger('focus')
832
  if (e && e.which === 3) return
833
  $(backdrop).remove()
834
  $(toggle).each(function () {
835
+ var $this = $(this)
836
+ var $parent = getParent($this)
837
  var relatedTarget = { relatedTarget: this }
838
+
839
  if (!$parent.hasClass('open')) return
840
+
841
  $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
842
+
843
  if (e.isDefaultPrevented()) return
844
+
845
+ $this.attr('aria-expanded', 'false')
846
  $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
847
  })
848
  }
896
  .on('click.bs.dropdown.data-api', clearMenus)
897
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
898
  .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
899
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
900
+ .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
901
+ .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
902
 
903
  }(jQuery);
904
 
905
  /* ========================================================================
906
+ * Bootstrap: modal.js v3.3.1
907
  * http://getbootstrap.com/javascript/#modals
908
  * ========================================================================
909
  * Copyright 2011-2014 Twitter, Inc.
934
  }
935
  }
936
 
937
+ Modal.VERSION = '3.3.1'
938
+
939
+ Modal.TRANSITION_DURATION = 300
940
+ Modal.BACKDROP_TRANSITION_DURATION = 150
941
 
942
  Modal.DEFAULTS = {
943
  backdrop: true,
960
  this.isShown = true
961
 
962
  this.checkScrollbar()
963
+ this.setScrollbar()
964
  this.$body.addClass('modal-open')
965
 
 
966
  this.escape()
967
+ this.resize()
968
 
969
  this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
970
 
979
  .show()
980
  .scrollTop(0)
981
 
982
+ if (that.options.backdrop) that.adjustBackdrop()
983
+ that.adjustDialog()
984
+
985
  if (transition) {
986
  that.$element[0].offsetWidth // force reflow
987
  }
999
  .one('bsTransitionEnd', function () {
1000
  that.$element.trigger('focus').trigger(e)
1001
  })
1002
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1003
  that.$element.trigger('focus').trigger(e)
1004
  })
1005
  }
1015
 
1016
  this.isShown = false
1017
 
 
 
 
1018
  this.escape()
1019
+ this.resize()
1020
 
1021
  $(document).off('focusin.bs.modal')
1022
 
1028
  $.support.transition && this.$element.hasClass('fade') ?
1029
  this.$element
1030
  .one('bsTransitionEnd', $.proxy(this.hideModal, this))
1031
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1032
  this.hideModal()
1033
  }
1034
 
1044
 
1045
  Modal.prototype.escape = function () {
1046
  if (this.isShown && this.options.keyboard) {
1047
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
1048
  e.which == 27 && this.hide()
1049
  }, this))
1050
  } else if (!this.isShown) {
1051
+ this.$element.off('keydown.dismiss.bs.modal')
1052
+ }
1053
+ }
1054
+
1055
+ Modal.prototype.resize = function () {
1056
+ if (this.isShown) {
1057
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
1058
+ } else {
1059
+ $(window).off('resize.bs.modal')
1060
  }
1061
  }
1062
 
1064
  var that = this
1065
  this.$element.hide()
1066
  this.backdrop(function () {
1067
+ that.$body.removeClass('modal-open')
1068
+ that.resetAdjustments()
1069
+ that.resetScrollbar()
1070
  that.$element.trigger('hidden.bs.modal')
1071
  })
1072
  }
1084
  var doAnimate = $.support.transition && animate
1085
 
1086
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
1087
+ .prependTo(this.$element)
1088
+ .on('click.dismiss.bs.modal', $.proxy(function (e) {
1089
+ if (e.target !== e.currentTarget) return
1090
+ this.options.backdrop == 'static'
1091
+ ? this.$element[0].focus.call(this.$element[0])
1092
+ : this.hide.call(this)
1093
+ }, this))
 
1094
 
1095
  if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1096
 
1101
  doAnimate ?
1102
  this.$backdrop
1103
  .one('bsTransitionEnd', callback)
1104
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1105
  callback()
1106
 
1107
  } else if (!this.isShown && this.$backdrop) {
1114
  $.support.transition && this.$element.hasClass('fade') ?
1115
  this.$backdrop
1116
  .one('bsTransitionEnd', callbackRemove)
1117
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1118
  callbackRemove()
1119
 
1120
  } else if (callback) {
1122
  }
1123
  }
1124
 
1125
+ // these following methods are used to handle overflowing modals
1126
+
1127
+ Modal.prototype.handleUpdate = function () {
1128
+ if (this.options.backdrop) this.adjustBackdrop()
1129
+ this.adjustDialog()
1130
+ }
1131
+
1132
+ Modal.prototype.adjustBackdrop = function () {
1133
+ this.$backdrop
1134
+ .css('height', 0)
1135
+ .css('height', this.$element[0].scrollHeight)
1136
+ }
1137
+
1138
+ Modal.prototype.adjustDialog = function () {
1139
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
1140
+
1141
+ this.$element.css({
1142
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
1143
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
1144
+ })
1145
+ }
1146
+
1147
+ Modal.prototype.resetAdjustments = function () {
1148
+ this.$element.css({
1149
+ paddingLeft: '',
1150
+ paddingRight: ''
1151
+ })
1152
+ }
1153
+
1154
  Modal.prototype.checkScrollbar = function () {
1155
+ this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
1156
+ this.scrollbarWidth = this.measureScrollbar()
1157
  }
1158
 
1159
  Modal.prototype.setScrollbar = function () {
1160
  var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1161
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1162
  }
1163
 
1164
  Modal.prototype.resetScrollbar = function () {
1228
  }(jQuery);
1229
 
1230
  /* ========================================================================
1231
+ * Bootstrap: tooltip.js v3.3.1
1232
  * http://getbootstrap.com/javascript/#tooltip
1233
  * Inspired by the original jQuery.tipsy by Jason Frame
1234
  * ========================================================================
1254
  this.init('tooltip', element, options)
1255
  }
1256
 
1257
+ Tooltip.VERSION = '3.3.1'
1258
+
1259
+ Tooltip.TRANSITION_DURATION = 150
1260
 
1261
  Tooltip.DEFAULTS = {
1262
  animation: true,
1334
  var self = obj instanceof this.constructor ?
1335
  obj : $(obj.currentTarget).data('bs.' + this.type)
1336
 
1337
+ if (self && self.$tip && self.$tip.is(':visible')) {
1338
+ self.hoverState = 'in'
1339
+ return
1340
+ }
1341
+
1342
  if (!self) {
1343
  self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1344
  $(obj.currentTarget).data('bs.' + this.type, self)
1381
  if (this.hasContent() && this.enabled) {
1382
  this.$element.trigger(e)
1383
 
1384
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
1385
  if (e.isDefaultPrevented() || !inDom) return
1386
  var that = this
1387
 
1417
 
1418
  if (autoPlace) {
1419
  var orgPlacement = placement
1420
+ var $container = this.options.container ? $(this.options.container) : this.$element.parent()
1421
+ var containerDim = this.getPosition($container)
1422
 
1423
+ placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
1424
+ placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
1425
+ placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
1426
+ placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
1427
  placement
1428
 
1429
  $tip
1436
  this.applyPlacement(calculatedOffset, placement)
1437
 
1438
  var complete = function () {
1439
+ var prevHoverState = that.hoverState
1440
  that.$element.trigger('shown.bs.' + that.type)
1441
  that.hoverState = null
1442
+
1443
+ if (prevHoverState == 'out') that.leave(that)
1444
  }
1445
 
1446
  $.support.transition && this.$tip.hasClass('fade') ?
1447
  $tip
1448
  .one('bsTransitionEnd', complete)
1449
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1450
  complete()
1451
  }
1452
  }
1493
  if (delta.left) offset.left += delta.left
1494
  else offset.top += delta.top
1495
 
1496
+ var isVertical = /top|bottom/.test(placement)
1497
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1498
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
1499
 
1500
  $tip.offset(offset)
1501
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1502
  }
1503
 
1504
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
1505
+ this.arrow()
1506
+ .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1507
+ .css(isHorizontal ? 'top' : 'left', '')
1508
  }
1509
 
1510
  Tooltip.prototype.setContent = function () {
1515
  $tip.removeClass('fade in top bottom left right')
1516
  }
1517
 
1518
+ Tooltip.prototype.hide = function (callback) {
1519
  var that = this
1520
  var $tip = this.tip()
1521
  var e = $.Event('hide.bs.' + this.type)
1522
 
 
 
1523
  function complete() {
1524
  if (that.hoverState != 'in') $tip.detach()
1525
+ that.$element
1526
+ .removeAttr('aria-describedby')
1527
+ .trigger('hidden.bs.' + that.type)
1528
+ callback && callback()
1529
  }
1530
 
1531
  this.$element.trigger(e)
1537
  $.support.transition && this.$tip.hasClass('fade') ?
1538
  $tip
1539
  .one('bsTransitionEnd', complete)
1540
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1541
  complete()
1542
 
1543
  this.hoverState = null
1558
 
1559
  Tooltip.prototype.getPosition = function ($element) {
1560
  $element = $element || this.$element
1561
+
1562
  var el = $element[0]
1563
  var isBody = el.tagName == 'BODY'
1564
+
1565
+ var elRect = el.getBoundingClientRect()
1566
+ if (elRect.width == null) {
1567
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
1568
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
1569
+ }
1570
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
1571
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
1572
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
1573
+
1574
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
1575
  }
1576
 
1577
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1635
  return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1636
  }
1637
 
 
 
 
 
 
 
 
 
1638
  Tooltip.prototype.enable = function () {
1639
  this.enabled = true
1640
  }
1661
  }
1662
 
1663
  Tooltip.prototype.destroy = function () {
1664
+ var that = this
1665
  clearTimeout(this.timeout)
1666
+ this.hide(function () {
1667
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
1668
+ })
1669
  }
1670
 
1671
 
1674
 
1675
  function Plugin(option) {
1676
  return this.each(function () {
1677
+ var $this = $(this)
1678
+ var data = $this.data('bs.tooltip')
1679
+ var options = typeof option == 'object' && option
1680
+ var selector = options && options.selector
1681
 
1682
  if (!data && option == 'destroy') return
1683
+ if (selector) {
1684
+ if (!data) $this.data('bs.tooltip', (data = {}))
1685
+ if (!data[selector]) data[selector] = new Tooltip(this, options)
1686
+ } else {
1687
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1688
+ }
1689
  if (typeof option == 'string') data[option]()
1690
  })
1691
  }
1707
  }(jQuery);
1708
 
1709
  /* ========================================================================
1710
+ * Bootstrap: popover.js v3.3.1
1711
  * http://getbootstrap.com/javascript/#popovers
1712
  * ========================================================================
1713
  * Copyright 2011-2014 Twitter, Inc.
1727
 
1728
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1729
 
1730
+ Popover.VERSION = '3.3.1'
1731
 
1732
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1733
  placement: 'right',
1754
  var content = this.getContent()
1755
 
1756
  $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1757
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
1758
  this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1759
  ](content)
1760
 
1794
 
1795
  function Plugin(option) {
1796
  return this.each(function () {
1797
+ var $this = $(this)
1798
+ var data = $this.data('bs.popover')
1799
+ var options = typeof option == 'object' && option
1800
+ var selector = options && options.selector
1801
 
1802
  if (!data && option == 'destroy') return
1803
+ if (selector) {
1804
+ if (!data) $this.data('bs.popover', (data = {}))
1805
+ if (!data[selector]) data[selector] = new Popover(this, options)
1806
+ } else {
1807
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1808
+ }
1809
  if (typeof option == 'string') data[option]()
1810
  })
1811
  }
1827
  }(jQuery);
1828
 
1829
  /* ========================================================================
1830
+ * Bootstrap: scrollspy.js v3.3.1
1831
  * http://getbootstrap.com/javascript/#scrollspy
1832
  * ========================================================================
1833
  * Copyright 2011-2014 Twitter, Inc.
1858
  this.process()
1859
  }
1860
 
1861
+ ScrollSpy.VERSION = '3.3.1'
1862
 
1863
  ScrollSpy.DEFAULTS = {
1864
  offset: 10
1919
  return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1920
  }
1921
 
1922
+ if (activeTarget && scrollTop < offsets[0]) {
1923
+ this.activeTarget = null
1924
+ return this.clear()
1925
  }
1926
 
1927
  for (i = offsets.length; i--;) {
1935
  ScrollSpy.prototype.activate = function (target) {
1936
  this.activeTarget = target
1937
 
1938
+ this.clear()
 
 
1939
 
1940
  var selector = this.selector +
1941
  '[data-target="' + target + '"],' +
1954
  active.trigger('activate.bs.scrollspy')
1955
  }
1956
 
1957
+ ScrollSpy.prototype.clear = function () {
1958
+ $(this.selector)
1959
+ .parentsUntil(this.options.target, '.active')
1960
+ .removeClass('active')
1961
+ }
1962
+
1963
 
1964
  // SCROLLSPY PLUGIN DEFINITION
1965
  // ===========================
2003
  }(jQuery);
2004
 
2005
  /* ========================================================================
2006
+ * Bootstrap: tab.js v3.3.1
2007
  * http://getbootstrap.com/javascript/#tabs
2008
  * ========================================================================
2009
  * Copyright 2011-2014 Twitter, Inc.
2021
  this.element = $(element)
2022
  }
2023
 
2024
+ Tab.VERSION = '3.3.1'
2025
+
2026
+ Tab.TRANSITION_DURATION = 150
2027
 
2028
  Tab.prototype.show = function () {
2029
  var $this = this.element
2037
 
2038
  if ($this.parent('li').hasClass('active')) return
2039
 
2040
+ var $previous = $ul.find('.active:last a')
2041
+ var hideEvent = $.Event('hide.bs.tab', {
2042
+ relatedTarget: $this[0]
2043
+ })
2044
+ var showEvent = $.Event('show.bs.tab', {
2045
+ relatedTarget: $previous[0]
2046
  })
2047
 
2048
+ $previous.trigger(hideEvent)
2049
+ $this.trigger(showEvent)
2050
 
2051
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
2052
 
2053
  var $target = $(selector)
2054
 
2055
  this.activate($this.closest('li'), $ul)
2056
  this.activate($target, $target.parent(), function () {
2057
+ $previous.trigger({
2058
+ type: 'hidden.bs.tab',
2059
+ relatedTarget: $this[0]
2060
+ })
2061
  $this.trigger({
2062
  type: 'shown.bs.tab',
2063
+ relatedTarget: $previous[0]
2064
  })
2065
  })
2066
  }
2069
  var $active = container.find('> .active')
2070
  var transition = callback
2071
  && $.support.transition
2072
+ && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
2073
 
2074
  function next() {
2075
  $active
2076
  .removeClass('active')
2077
  .find('> .dropdown-menu > .active')
2078
+ .removeClass('active')
2079
+ .end()
2080
+ .find('[data-toggle="tab"]')
2081
+ .attr('aria-expanded', false)
2082
 
2083
+ element
2084
+ .addClass('active')
2085
+ .find('[data-toggle="tab"]')
2086
+ .attr('aria-expanded', true)
2087
 
2088
  if (transition) {
2089
  element[0].offsetWidth // reflow for transition
2093
  }
2094
 
2095
  if (element.parent('.dropdown-menu')) {
2096
+ element
2097
+ .closest('li.dropdown')
2098
+ .addClass('active')
2099
+ .end()
2100
+ .find('[data-toggle="tab"]')
2101
+ .attr('aria-expanded', true)
2102
  }
2103
 
2104
  callback && callback()
2105
  }
2106
 
2107
+ $active.length && transition ?
2108
  $active
2109
  .one('bsTransitionEnd', next)
2110
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
2111
  next()
2112
 
2113
  $active.removeClass('in')
2145
  // TAB DATA-API
2146
  // ============
2147
 
2148
+ var clickHandler = function (e) {
2149
  e.preventDefault()
2150
  Plugin.call($(this), 'show')
2151
+ }
2152
+
2153
+ $(document)
2154
+ .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
2155
+ .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
2156
 
2157
  }(jQuery);
2158
 
2159
  /* ========================================================================
2160
+ * Bootstrap: affix.js v3.3.1
2161
  * http://getbootstrap.com/javascript/#affix
2162
  * ========================================================================
2163
  * Copyright 2011-2014 Twitter, Inc.
2186
  this.checkPosition()
2187
  }
2188
 
2189
+ Affix.VERSION = '3.3.1'
2190
 
2191
  Affix.RESET = 'affix affix-top affix-bottom'
2192
 
2195
  target: window
2196
  }
2197
 
2198
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
2199
+ var scrollTop = this.$target.scrollTop()
2200
+ var position = this.$element.offset()
2201
+ var targetHeight = this.$target.height()
2202
+
2203
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
2204
+
2205
+ if (this.affixed == 'bottom') {
2206
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
2207
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
2208
+ }
2209
+
2210
+ var initializing = this.affixed == null
2211
+ var colliderTop = initializing ? scrollTop : position.top
2212
+ var colliderHeight = initializing ? targetHeight : height
2213
+
2214
+ if (offsetTop != null && colliderTop <= offsetTop) return 'top'
2215
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
2216
+
2217
+ return false
2218
+ }
2219
+
2220
  Affix.prototype.getPinnedOffset = function () {
2221
  if (this.pinnedOffset) return this.pinnedOffset
2222
  this.$element.removeClass(Affix.RESET).addClass('affix')
2232
  Affix.prototype.checkPosition = function () {
2233
  if (!this.$element.is(':visible')) return
2234
 
2235
+ var height = this.$element.height()
 
 
2236
  var offset = this.options.offset
2237
  var offsetTop = offset.top
2238
  var offsetBottom = offset.bottom
2239
+ var scrollHeight = $('body').height()
2240
 
2241
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
2242
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
2243
  if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
2244
 
2245
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
 
 
2246
 
2247
+ if (this.affixed != affix) {
2248
+ if (this.unpin != null) this.$element.css('top', '')
2249
 
2250
+ var affixType = 'affix' + (affix ? '-' + affix : '')
2251
+ var e = $.Event(affixType + '.bs.affix')
2252
 
2253
+ this.$element.trigger(e)
2254
 
2255
+ if (e.isDefaultPrevented()) return
2256
 
2257
+ this.affixed = affix
2258
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
2259
 
2260
+ this.$element
2261
+ .removeClass(Affix.RESET)
2262
+ .addClass(affixType)
2263
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
2264
+ }
2265
 
2266
  if (affix == 'bottom') {
2267
  this.$element.offset({
2268
+ top: scrollHeight - height - offsetBottom
2269
  })
2270
  }
2271
  }
2310
 
2311
  data.offset = data.offset || {}
2312
 
2313
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
2314
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
2315
 
2316
  Plugin.call($spy, data)
2317
  })
assets/bootstrap/js/bootstrap.min.js CHANGED
@@ -1,6 +1,7 @@
1
  /*!
2
- * Bootstrap v3.2.0 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
- if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f+', [role="menu"], [role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.2.0",c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(c.$body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one("bsTransitionEnd",function(){c.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(300):c.$element.trigger("focus").trigger(e)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;if(this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;e?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(150):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var f=function(){c.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",f).emulateTransitionEnd(150):f()}else b&&b()},c.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.2.0",c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var c=a.contains(document.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!c)return;var d=this,e=this.tip(),f=this.getUID(this.type);this.setContent(),e.attr("id",f),this.$element.attr("aria-describedby",f),this.options.animation&&e.addClass("fade");var g="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,h=/\s?auto?\s?/i,i=h.test(g);i&&(g=g.replace(h,"")||"top"),e.detach().css({top:0,left:0,display:"block"}).addClass(g).data("bs."+this.type,this),this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element);var j=this.getPosition(),k=e[0].offsetWidth,l=e[0].offsetHeight;if(i){var m=g,n=this.$element.parent(),o=this.getPosition(n);g="bottom"==g&&j.top+j.height+l-o.scroll>o.height?"top":"top"==g&&j.top-o.scroll-l<0?"bottom":"right"==g&&j.right+k>o.width?"left":"left"==g&&j.left-k<o.left?"right":g,e.removeClass(m).addClass(g)}var p=this.getCalculatedOffset(g,j,k,l);this.applyPlacement(p,g);var q=function(){d.$element.trigger("shown.bs."+d.type),d.hoverState=null};a.support.transition&&this.$tip.hasClass("fade")?e.one("bsTransitionEnd",q).emulateTransitionEnd(150):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=k.left?2*k.left-e+i:2*k.top-f+j,m=k.left?"left":"top",n=k.left?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(l,d[0][n],m)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.removeAttr("aria-describedby"),this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one("bsTransitionEnd",b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName;return a.extend({},"function"==typeof c.getBoundingClientRect?c.getBoundingClientRect():null,{scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop(),width:d?a(window).width():b.outerWidth(),height:d?a(window).height():b.outerHeight()},d?{top:0,left:0}:b.offset())},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.2.0",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").empty()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.2.0",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.2.0",c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.closest("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},c.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one("bsTransitionEnd",e).emulateTransitionEnd(150):e(),f.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault(),b.call(a(this),"show")})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.2.0",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=a(document).height(),d=this.$target.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=b-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){null!=this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:b-this.$element.height()-h}))}}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},d.offsetBottom&&(d.offset.bottom=d.offsetBottom),d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
 
1
  /*!
2
+ * Bootstrap v3.3.1 (http://getbootstrap.com)
3
  * Copyright 2011-2014 Twitter, Inc.
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
+ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.1",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.1",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c="prev"==a?-1:1,d=this.getItemIndex(b),e=(d+c)%this.$items.length;return this.$items.eq(e)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i="next"==b?"first":"last",j=this;if(!f.length){if(!this.options.wrap)return;f=this.$element.find(".item")[i]()}if(f.hasClass("active"))return this.sliding=!1;var k=f[0],l=a.Event("slide.bs.carousel",{relatedTarget:k,direction:h});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var m=a(this.$indicators.children()[this.getItemIndex(f)]);m&&m.addClass("active")}var n=a.Event("slid.bs.carousel",{relatedTarget:k,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),j.sliding=!1,setTimeout(function(){j.$element.trigger(n)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(n)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.1",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.find("> .panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.1",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.1",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.options.backdrop&&d.adjustBackdrop(),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$element.find(".modal-dialog").one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b,g=f&&f.selector;(e||"destroy"!=b)&&(g?(e||d.data("bs.tooltip",e={}),e[g]||(e[g]=new c(this,f))):e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.1",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=this.tip(),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b,g=f&&f.selector;(e||"destroy"!=b)&&(g?(e||d.data("bs.popover",e={}),e[g]||(e[g]=new c(this,f))):e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.1",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.1",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.1",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})
7
+ })}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.1",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=i?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
config.php CHANGED
@@ -8,31 +8,31 @@
8
 
9
  /** Define the server path to the file wp-config here, if you placed WP-CONTENT outside the classic file structure */
10
 
11
- if(!isset($path)){
12
  $path = ''; // It should be end with a trailing slash
13
  };
14
 
15
  /** That's all, stop editing from here **/
16
 
17
- if(!defined('WP_LOAD_PATH')){
18
 
19
  /** classic root path if wp-content and plugins is below wp-config.php */
20
- preg_match('|^(.*?/)(wp-content)/|i', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']), $_m);
21
  $classic_root = $_m[1];
22
 
23
- if(file_exists($path . 'wp-load.php')){
24
- define('WP_LOAD_PATH', $path);
25
- } elseif(file_exists($classic_root . 'wp-load.php')){
26
- define('WP_LOAD_PATH', $classic_root);
27
- } else{
28
- $classic_root = dirname(dirname(dirname(dirname(str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']))))) . '/';
29
- if(file_exists($classic_root . 'wp-load.php')){
30
- define('WP_LOAD_PATH', $classic_root);
31
- } else{
32
- exit("Could not find wp-load.php");
33
  }
34
  }
35
  }
36
 
37
  // let's load WordPress
38
- require_once(WP_LOAD_PATH . 'wp-load.php');
8
 
9
  /** Define the server path to the file wp-config here, if you placed WP-CONTENT outside the classic file structure */
10
 
11
+ if ( ! isset( $path ) ) {
12
  $path = ''; // It should be end with a trailing slash
13
  };
14
 
15
  /** That's all, stop editing from here **/
16
 
17
+ if ( ! defined( 'WP_LOAD_PATH' ) ) {
18
 
19
  /** classic root path if wp-content and plugins is below wp-config.php */
20
+ preg_match( '|^(.*?/)(wp-content)/|i', str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), $_m );
21
  $classic_root = $_m[1];
22
 
23
+ if ( file_exists( $path . 'wp-load.php' ) ) {
24
+ define( 'WP_LOAD_PATH', $path );
25
+ } elseif ( file_exists( $classic_root . 'wp-load.php' ) ) {
26
+ define( 'WP_LOAD_PATH', $classic_root );
27
+ } else {
28
+ $classic_root = dirname( dirname( dirname( dirname( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ) ) ) ) ) . '/';
29
+ if ( file_exists( $classic_root . 'wp-load.php' ) ) {
30
+ define( 'WP_LOAD_PATH', $classic_root );
31
+ } else {
32
+ exit( "Could not find wp-load.php" );
33
  }
34
  }
35
  }
36
 
37
  // let's load WordPress
38
+ require_once( WP_LOAD_PATH . 'wp-load.php' );
gallery.php CHANGED
@@ -24,6 +24,7 @@ if($gmedia){
24
  $atts = array(
25
  'id' => $term_id,
26
  'preview' => $gmCore->_get('preview', ''),
 
27
  '_tax' => $type
28
  );
29
  $content = gmedia_shortcode($atts);
24
  $atts = array(
25
  'id' => $term_id,
26
  'preview' => $gmCore->_get('preview', ''),
27
+ 'preset' => $gmCore->_get('preset', 0),
28
  '_tax' => $type
29
  );
30
  $content = gmedia_shortcode($atts);
grand-media.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gmedia Gallery
4
  Plugin URI: http://wordpress.org/extend/plugins/grand-media/
5
  Description: Gmedia Gallery - powerfull media library plugin for creating beautiful galleries and managing files.
6
- Version: 1.2.6
7
  Author: Rattus
8
  Author URI: http://codeasily.com/
9
 
@@ -39,7 +39,7 @@ if(!class_exists('Gmedia')){
39
  */
40
  class Gmedia{
41
 
42
- var $version = '1.2.6';
43
  var $dbversion = '0.9.6';
44
  var $minium_WP = '3.5';
45
  var $options = '';
@@ -252,8 +252,8 @@ if(!class_exists('Gmedia')){
252
  'pluginPath' => $gmCore->gmedia_url
253
  ));
254
 
255
- wp_register_style('grand-media', $gmCore->gmedia_url . '/admin/css/grand-media.css', array(), '1.2.5', 'all');
256
- wp_register_script('grand-media', $gmCore->gmedia_url . '/admin/js/grand-media.js', array('jquery', 'gmedia-global-backend'), '1.2.5');
257
  wp_localize_script('grand-media', 'grandMedia', array(
258
  'error3' => __('Disable your Popup Blocker and try again.', 'gmLang'),
259
  'download' => __('downloading...', 'gmLang'),
@@ -261,8 +261,8 @@ if(!class_exists('Gmedia')){
261
  'nonce' => wp_create_nonce('grandMedia')
262
  ));
263
 
264
- wp_register_style('gmedia-bootstrap', $gmCore->gmedia_url . '/assets/bootstrap/css/bootstrap.min.css', array(), '3.2.0', 'screen');
265
- wp_register_script('gmedia-bootstrap', $gmCore->gmedia_url . '/assets/bootstrap/js/bootstrap.min.js', array('jquery'), '3.2.0');
266
 
267
  wp_register_script('outside-events', $gmCore->gmedia_url . '/assets/jq-plugins/outside-events.js', array('jquery'), '1.1');
268
 
@@ -307,8 +307,9 @@ if(!class_exists('Gmedia')){
307
 
308
  function load_module_scripts(){
309
  $deps = array();
310
- foreach($this->do_module as $module){
311
  $deps = array_merge($deps, explode(',', $module['info']['dependencies']));
 
312
  foreach($deps as $handle){
313
  if(wp_script_is($handle, 'registered')){
314
  wp_enqueue_script($handle, $_src = false, $_deps = array('jquery'), $_ver = false, $_in_footer = true);
3
  Plugin Name: Gmedia Gallery
4
  Plugin URI: http://wordpress.org/extend/plugins/grand-media/
5
  Description: Gmedia Gallery - powerfull media library plugin for creating beautiful galleries and managing files.
6
+ Version: 1.3.7
7
  Author: Rattus
8
  Author URI: http://codeasily.com/
9
 
39
  */
40
  class Gmedia{
41
 
42
+ var $version = '1.3.7';
43
  var $dbversion = '0.9.6';
44
  var $minium_WP = '3.5';
45
  var $options = '';
252
  'pluginPath' => $gmCore->gmedia_url
253
  ));
254
 
255
+ wp_register_style('grand-media', $gmCore->gmedia_url . '/admin/css/grand-media.css', array(), '1.3.7', 'all');
256
+ wp_register_script('grand-media', $gmCore->gmedia_url . '/admin/js/grand-media.js', array('jquery', 'gmedia-global-backend'), '1.3.4');
257
  wp_localize_script('grand-media', 'grandMedia', array(
258
  'error3' => __('Disable your Popup Blocker and try again.', 'gmLang'),
259
  'download' => __('downloading...', 'gmLang'),
261
  'nonce' => wp_create_nonce('grandMedia')
262
  ));
263
 
264
+ wp_register_style('gmedia-bootstrap', $gmCore->gmedia_url . '/assets/bootstrap/css/bootstrap.min.css', array(), '3.3.1', 'all');
265
+ wp_register_script('gmedia-bootstrap', $gmCore->gmedia_url . '/assets/bootstrap/js/bootstrap.min.js', array('jquery'), '3.3.1');
266
 
267
  wp_register_script('outside-events', $gmCore->gmedia_url . '/assets/jq-plugins/outside-events.js', array('jquery'), '1.1');
268
 
307
 
308
  function load_module_scripts(){
309
  $deps = array();
310
+ foreach($this->do_module as $m => $module){
311
  $deps = array_merge($deps, explode(',', $module['info']['dependencies']));
312
+ $deps = apply_filters('gmedia_'.$m.'_dependencies', $deps);
313
  foreach($deps as $handle){
314
  if(wp_script_is($handle, 'registered')){
315
  wp_enqueue_script($handle, $_src = false, $_deps = array('jquery'), $_ver = false, $_in_footer = true);
inc/core.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
- if(preg_match('#' . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
3
- die('You are not allowed to call this page directly.');
4
  }
5
 
6
  /**
7
  * Main PHP class for the WordPress plugin GRAND Media
8
 
9
  */
10
- class GmediaCore{
11
 
12
  var $upload;
13
  var $gmedia_url;
@@ -17,22 +17,28 @@ class GmediaCore{
17
  /**
18
  *
19
  */
20
- function __construct(){
21
- $this->upload = $this->gm_upload_dir();
22
- $this->gmedia_url = plugins_url(GMEDIA_FOLDER);
23
 
24
- add_action('init', array(&$this, 'capabilities'), 8);
25
  }
26
 
27
- function capabilities(){
28
- $curuser = wp_get_current_user();
29
  $capabilities = gmedia_plugin_capabilities();
30
- $capabilities = apply_filters('gmedia_capabilities', $capabilities);
31
- foreach($capabilities as $cap){
32
- if(isset($curuser->allcaps[$cap]) && intval($curuser->allcaps[$cap])){
33
- $this->caps[$cap] = 1;
34
- } else{
35
- $this->caps[$cap] = 0;
 
 
 
 
 
 
 
36
  }
37
  }
38
  }
@@ -41,60 +47,60 @@ class GmediaCore{
41
  * Check GET data
42
  *
43
  * @param string $var
44
- * @param mixed $def
45
  *
46
  * @return mixed
47
  */
48
- function _get($var = '', $def = false){
49
- return isset($_GET[$var])? $_GET[$var] : $def;
50
  }
51
 
52
  /**
53
  * Check POST data
54
  *
55
- * @param string $var
56
  * @param bool|mixed $def
57
  *
58
  * @return mixed
59
  */
60
 
61
- function _post($var = '', $def = false){
62
- return isset($_POST[$var])? $_POST[$var] : $def;
63
  }
64
 
65
  /**
66
  * Check REQUEST data
67
  *
68
  * @param string $var
69
- * @param bool $def
70
  *
71
  * @return mixed
72
  */
73
- function _req($var = '', $def = false){
74
- return isset($_REQUEST[$var])? $_REQUEST[$var] : $def;
75
  }
76
 
77
  /**
78
  * tooltip()
79
  *
80
  * @param string $style 'tooltip', 'popover'
81
- * @param array $params
82
- * @param bool $print
83
  *
84
  * @return string
85
  */
86
- function tooltip($style, $params, $print = true){
87
  $show_tip = 0; // TODO show tooltips checkbox in settings
88
- if($show_tip){
89
  $tooltip = " data-toggle='$style'";
90
- if(is_array($params) && !empty($params)){
91
- foreach($params as $key => $val){
92
  $tooltip .= " data-$key='$val'";
93
  }
94
  }
95
- if($print){
96
  echo $tooltip;
97
- } else{
98
  return $tooltip;
99
  }
100
  }
@@ -105,18 +111,18 @@ class GmediaCore{
105
  /**
106
  * @param array $add_args
107
  * @param array $remove_args
108
- * @param bool $uri
109
  *
110
  * @return string
111
  */
112
- function get_admin_url($add_args = array(), $remove_args = array(), $uri = false){
113
- if(true === $uri){
114
- $uri = admin_url('admin.php');
115
  }
116
- $remove_args = array_unique(array_merge(array('doing_wp_cron', '_wpnonce', 'delete'), $remove_args, array_keys($add_args)));
117
- $new_uri = remove_query_arg($remove_args, $uri);
118
- if(!empty($add_args)){
119
- $new_uri = add_query_arg($add_args, $new_uri);
120
  }
121
 
122
  return $new_uri;
@@ -127,9 +133,9 @@ class GmediaCore{
127
  *
128
  * @return bool
129
  */
130
- function is_crawler($userAgent){
131
- $crawlers = 'Google|msnbot|Rambler|Yahoo|AbachoBOT|accoona|FeedBurner|' . 'AcioRobot|ASPSeek|CocoCrawler|Dumbot|FAST-WebCrawler|' . 'GeonaBot|Gigabot|Lycos|MSRBOT|Scooter|AltaVista|IDBot|eStyle|Scrubby|yandex|facebook';
132
- $isCrawler = (preg_match("/$crawlers/i", $userAgent) > 0);
133
 
134
  return $isCrawler;
135
  }
@@ -139,9 +145,9 @@ class GmediaCore{
139
  *
140
  * @return bool
141
  */
142
- function is_browser($userAgent){
143
- $browsers = 'opera|aol|msie|firefox|chrome|konqueror|safari|netscape|navigator|mosaic|lynx|amaya|omniweb|avant|camino|flock|seamonkey|mozilla|gecko';
144
- $isBrowser = (preg_match("/$browsers/i", $userAgent) > 0);
145
 
146
  return $isBrowser;
147
  }
@@ -162,25 +168,27 @@ class GmediaCore{
162
  *
163
  * @return array See above for description.
164
  */
165
- function gm_upload_dir($create = true){
166
  $slash = '/';
167
  // If multisite (and if not the main site)
168
- if(is_multisite() && !is_main_site()){
169
  $slash = '/blogs.dir/' . get_current_blog_id() . '/';
170
  }
171
 
172
  $dir = WP_CONTENT_DIR . $slash . GMEDIA_UPLOAD_FOLDER;
173
  $url = WP_CONTENT_URL . $slash . GMEDIA_UPLOAD_FOLDER;
174
 
175
- $uploads = apply_filters('gm_upload_dir', array('path' => $dir, 'url' => $url, 'error' => false));
176
 
177
- if($create){
 
 
178
  // Make sure we have an uploads dir
179
- if(!wp_mkdir_p($uploads['path'])){
180
- $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), $uploads['path']);
181
  $uploads['error'] = $message;
182
  }
183
- } elseif(!is_dir($uploads['path'])){
184
  $uploads['error'] = true;
185
  }
186
 
@@ -192,17 +200,17 @@ class GmediaCore{
192
  *
193
  * @return bool|null
194
  */
195
- function delete_folder($path){
196
- $path = rtrim($path, '/');
197
- if(is_file($path)){
198
- return @unlink($path);
199
- } elseif(is_dir($path)){
200
- $files = glob($path . '/*', GLOB_NOSORT);
201
- if(!empty($files) && is_array($files)){
202
- array_map(array($this, 'delete_folder'), $files);
203
  }
204
 
205
- return @rmdir($path);
206
  }
207
 
208
  return null;
@@ -214,25 +222,25 @@ class GmediaCore{
214
  * @see wp_get_attachment_image()
215
  * @uses apply_filters() Calls 'gm_get_attachment_image_attributes' hook on attributes array
216
  *
217
- * @param int|object $item Image object.
218
- * @param string $size Optional, default is empty string, could be 'thumb', 'original'
219
- * @param bool $cover Optional, try to get cover url
220
  * @param bool|string $default Optional, return if no cover
221
  *
222
  * @return string img url
223
  */
224
- function gm_get_media_image($item, $size = '', $cover = true, $default = false){
225
  global $gmDB, $gmGallery;
226
 
227
- if(!is_object($item)){
228
- $item = $gmDB->get_gmedia($item);
229
  }
230
- $type = explode('/', $item->mime_type);
231
 
232
- if('image' == $type[0]){
233
- $type_folder = $this->upload['url'] . '/' . $gmGallery->options['folder'][$type[0]];
234
 
235
- switch($size){
236
  case 'thumb':
237
  $size_folder = '/thumb/';
238
  break;
@@ -246,22 +254,22 @@ class GmediaCore{
246
  }
247
 
248
  $image = $type_folder . $size_folder . $item->gmuid;
249
- } else{
250
- $ext = ltrim(strrchr($item->gmuid, '.'), '.');
251
- if(!$type = wp_ext2type($ext)){
252
  $type = 'application';
253
  }
254
  $image = $this->gmedia_url . '/admin/images/' . $type . '.png';
255
 
256
- if($cover){
257
- $cover = $gmDB->get_metadata('gmedia', $item->ID, 'cover', true);
258
- if(!empty($cover)){
259
- if($this->is_digit($cover)){
260
- $image = $this->gm_get_media_image((int)$cover, $size, false);
261
- } elseif(('thumb' != $size) && (false !== filter_var($cover, FILTER_VALIDATE_URL))){
262
  return $cover;
263
  }
264
- } elseif(false !== $default){
265
  return $default;
266
  }
267
  }
@@ -277,23 +285,23 @@ class GmediaCore{
277
  *
278
  * @return array|bool Return array( 'path', 'url' ) OR false if no module
279
  */
280
- function get_module_path($module_name){
281
  global $gmGallery;
282
- if(empty($module_name)){
283
  return false;
284
  }
285
  $module_dirs = array(
286
  'upload' => array(
287
  'path' => $this->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/' . $module_name,
288
- 'url' => $this->upload['url'] . '/' . $gmGallery->options['folder']['module'] . '/' . $module_name
289
  ),
290
  'plugin' => array(
291
  'path' => GMEDIA_ABSPATH . 'module/' . $module_name,
292
- 'url' => plugins_url(GMEDIA_FOLDER) . '/module/' . $module_name
293
  ),
294
  );
295
- foreach($module_dirs as $dir){
296
- if(is_dir($dir['path'])){
297
  return $dir;
298
  }
299
  }
@@ -304,47 +312,56 @@ class GmediaCore{
304
  /** Automatic choose upload directory based on media type
305
  *
306
  * @param string $file
307
- * @param int $exists
308
  *
309
- * @return array
310
  */
311
- function fileinfo($file, $exists = 0){
312
- global $gmGallery;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
 
314
- $file = basename($file);
315
- $file_lower = strtolower($file);
316
- $filetype = wp_check_filetype($file_lower, $mimes = null);
317
- $title = pathinfo($file, PATHINFO_FILENAME);
318
- $pathinfo = pathinfo(preg_replace('/[^a-z0-9_\.-]+/i', '_', $file));
319
- $pathinfo['extension'] = strtolower($pathinfo['extension']);
320
- $suffix = ((false !== $exists) && absint($exists))? "_$exists" : '';
321
-
322
- $fileinfo['extension'] = (empty($filetype['ext']))? $pathinfo['extension'] : $filetype['ext'];
323
- $fileinfo['filename'] = $pathinfo['filename'] . $suffix;
324
- $fileinfo['basename'] = $fileinfo['filename'] . '.' . $fileinfo['extension'];
325
- $fileinfo['title'] = ucwords(str_replace('_', ' ', esc_sql($title)));
326
- $fileinfo['mime_type'] = (empty($filetype['type']))? 'application/' . $fileinfo['extension'] : $filetype['type'];
327
- list($dirname) = explode('/', $fileinfo['mime_type']);
328
- $fileinfo['dirname'] = $dirname;
329
- $fileinfo['dirpath'] = $this->upload['path'] . '/' . $gmGallery->options['folder'][$dirname];
330
- $fileinfo['dirurl'] = $this->upload['url'] . '/' . $gmGallery->options['folder'][$dirname];
331
- $fileinfo['filepath'] = $fileinfo['dirpath'] . '/' . $fileinfo['basename'];
332
- $fileinfo['fileurl'] = $fileinfo['dirurl'] . '/' . $fileinfo['basename'];
333
  $fileinfo['fileurl_original'] = $fileinfo['dirurl'] . '/' . $fileinfo['basename'];
334
- if('image' == $dirname){
335
- $fileinfo['dirpath_original'] = $this->upload['path'] . '/' . $gmGallery->options['folder']['image_original'];
336
- $fileinfo['dirurl_original'] = $this->upload['url'] . '/' . $gmGallery->options['folder']['image_original'];
337
  $fileinfo['filepath_original'] = $fileinfo['dirpath_original'] . '/' . $fileinfo['basename'];
338
- $fileinfo['fileurl_original'] = $fileinfo['dirurl_original'] . '/' . $fileinfo['basename'];
339
- $fileinfo['dirpath_thumb'] = $this->upload['path'] . '/' . $gmGallery->options['folder']['image_thumb'];
340
- $fileinfo['dirurl_thumb'] = $this->upload['url'] . '/' . $gmGallery->options['folder']['image_thumb'];
341
- $fileinfo['filepath_thumb'] = $fileinfo['dirpath_thumb'] . '/' . $fileinfo['basename'];
342
- $fileinfo['fileurl_thumb'] = $fileinfo['dirurl_thumb'] . '/' . $fileinfo['basename'];
343
  }
344
 
345
- if((false !== $exists) && file_exists($fileinfo['filepath'])){
346
- $exists = absint($exists) + 1;
347
- $fileinfo = $this->fileinfo($file, $exists);
348
  }
349
 
350
  return $fileinfo;
@@ -354,10 +371,10 @@ class GmediaCore{
354
  *
355
  * @param string $new_file
356
  */
357
- function file_chmod($new_file){
358
- $stat = stat(dirname($new_file));
359
  $perms = $stat['mode'] & 0000666;
360
- @chmod($new_file, $perms);
361
  }
362
 
363
  /**
@@ -367,7 +384,7 @@ class GmediaCore{
367
  *
368
  * @return mixed
369
  */
370
- function clean_input($input){
371
  $search = array(
372
  /*'@<[\/\!]*?[^<>]*?>@si'*/ /* Strip out HTML tags */
373
  '@<script[^>]*?>.*?</script>@si' /* Strip out javascript */,
@@ -376,7 +393,7 @@ class GmediaCore{
376
  //,'/\s{3,}/'
377
  );
378
 
379
- $output = preg_replace($search, '', $input);
380
 
381
  return $output;
382
  }
@@ -388,18 +405,18 @@ class GmediaCore{
388
  *
389
  * @return mixed
390
  */
391
- function sanitize($input){
392
  $output = $input;
393
- if(is_array($input)){
394
- foreach($input as $var => $val){
395
- $output[$var] = $this->sanitize($val);
396
  }
397
- } else{
398
- if(get_magic_quotes_gpc()){
399
- $input = stripslashes($input);
400
  }
401
- $input = $this->clean_input($input);
402
- $output = esc_sql($input);
403
  }
404
 
405
  return $output;
@@ -412,12 +429,12 @@ class GmediaCore{
412
  *
413
  * @return bool
414
  */
415
- function is_digit($digit){
416
- if(is_int($digit)){
417
  return true;
418
- } elseif(is_string($digit) && !empty($digit)){
419
- return ctype_digit($digit);
420
- } else{
421
  // booleans, floats and others
422
  return false;
423
  }
@@ -428,9 +445,9 @@ class GmediaCore{
428
  *
429
  * @return array
430
  */
431
- function get_editable_user_ids(){
432
- if(current_user_can('gmedia_show_others_media') || current_user_can('gmedia_edit_others_media')){
433
- return get_users(array('who' => 'authors', 'fields' => 'ID'));
434
  }
435
 
436
  return get_current_user_id();
@@ -444,28 +461,28 @@ class GmediaCore{
444
  *
445
  * @return string
446
  */
447
- function filesize($file, $decimals = 2){
448
- $bytes = filesize($file);
449
- $sz = array('b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb');
450
- $factor = (int)floor((strlen($bytes) - 1) / 3);
451
 
452
- return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . $sz[$factor];
453
  }
454
 
455
  /**
456
  * @author Gajus Kuizinas <g.kuizinas@anuary.com>
457
  * @version 1.0.0 (2013 03 19)
458
  */
459
- function array_diff_key_recursive(array $arr1, array $arr2){
460
- $diff = array_diff_key($arr1, $arr2);
461
- $intersect = array_intersect_key($arr1, $arr2);
462
 
463
- foreach($intersect as $k => $v){
464
- if(is_array($arr1[$k]) && is_array($arr2[$k])){
465
- $d = $this->array_diff_key_recursive($arr1[$k], $arr2[$k]);
466
 
467
- if(!empty($d)){
468
- $diff[$k] = $d;
469
  }
470
  }
471
  }
@@ -476,26 +493,26 @@ class GmediaCore{
476
  /**
477
  * @param array $arr1
478
  * @param array $arr2
479
- * @param bool $update
480
  *
481
  * @return array
482
  */
483
- function array_diff_keyval_recursive(array $arr1, array $arr2, $update = false){
484
- $diff = array_diff_key($arr1, $arr2);
485
- $intersect = array_intersect_key($arr1, $arr2);
486
 
487
- foreach($intersect as $k => $v){
488
- if(is_array($arr1[$k]) && is_array($arr2[$k])){
489
- $d = $this->array_diff_keyval_recursive($arr1[$k], $arr2[$k], $update);
490
 
491
- if(!empty($d)){
492
- $diff[$k] = $d;
493
  }
494
- } elseif($arr1[$k] !== $arr2[$k]){
495
- if($update){
496
- $diff[$k] = $arr2[$k];
497
- } else{
498
- $diff[$k] = $arr1[$k];
499
  }
500
  }
501
  }
@@ -509,32 +526,32 @@ class GmediaCore{
509
  *
510
  * @return mixed
511
  */
512
- function array_replace_recursive($base, $replacements){
513
- if(function_exists('array_replace_recursive')){
514
- return array_replace_recursive($base, $replacements);
515
  }
516
 
517
- foreach(array_slice(func_get_args(), 1) as $replacements){
518
- $bref_stack = array(&$base);
519
- $head_stack = array($replacements);
520
 
521
- do{
522
- end($bref_stack);
523
 
524
- $bref = & $bref_stack[key($bref_stack)];
525
- $head = array_pop($head_stack);
526
 
527
- unset($bref_stack[key($bref_stack)]);
528
 
529
- foreach(array_keys($head) as $key){
530
- if(isset($key, $bref) && is_array($bref[$key]) && is_array($head[$key])){
531
- $bref_stack[] = & $bref[$key];
532
- $head_stack[] = $head[$key];
533
- } else{
534
- $bref[$key] = $head[$key];
535
  }
536
  }
537
- } while(count($head_stack));
538
  }
539
 
540
  return $base;
@@ -545,22 +562,22 @@ class GmediaCore{
545
  *
546
  * @return array|bool
547
  */
548
- function process_gmedit_image($photo){
549
  $type = null;
550
- if(preg_match('/^data:image\/(jpg|jpeg|png|gif)/i', $photo, $matches)){
551
  $type = $matches[1];
552
- } else{
553
  return false;
554
  }
555
  // Remove the mime-type header
556
- $data = explode('base64,', $photo);
557
- $data = array_reverse($data);
558
- $data = reset($data);
559
 
560
  // Use strict mode to prevent characters from outside the base64 range
561
- $image = base64_decode($data, true);
562
 
563
- if(!$image){
564
  return false;
565
  }
566
 
@@ -573,10 +590,10 @@ class GmediaCore{
573
  /**
574
  * @return bool
575
  */
576
- function is_bot(){
577
- if ( empty($_SERVER['HTTP_USER_AGENT']) ) {
578
- return false;
579
- }
580
 
581
  $spiders = array(
582
  "abot",
@@ -965,9 +982,9 @@ class GmediaCore{
965
  "...."
966
  );
967
 
968
- foreach($spiders as $spider){
969
  //If the spider text is found in the current user agent, then return true
970
- if(stripos($_SERVER['HTTP_USER_AGENT'], $spider) !== false){
971
  return true;
972
  break;
973
  }
@@ -983,17 +1000,17 @@ class GmediaCore{
983
  * @since 3.6.0
984
  *
985
  * @param array $metadata An existing array with data
986
- * @param array $data Data supplied by ID3 tags
987
  */
988
- function wp_add_id3_tag_data(&$metadata, $data){
989
- foreach(array('id3v2', 'id3v1') as $version){
990
- if(!empty($data[$version]['comments'])){
991
- foreach($data[$version]['comments'] as $key => $list){
992
- if(!empty($list)){
993
- $metadata[$key] = reset($list);
994
  // fix bug in byte stream analysis
995
- if('terms_of_use' === $key && 0 === strpos($metadata[$key], 'yright notice.')){
996
- $metadata[$key] = 'Cop' . $metadata[$key];
997
  }
998
  }
999
  }
@@ -1001,19 +1018,19 @@ class GmediaCore{
1001
  }
1002
  }
1003
 
1004
- if(!empty($data['id3v2']['APIC'])){
1005
- $image = reset($data['id3v2']['APIC']);
1006
- if(!empty($image['data'])){
1007
  $metadata['image'] = array(
1008
- 'data' => $image['data'],
1009
- 'mime' => $image['image_mime'],
1010
- 'width' => $image['image_width'],
1011
  'height' => $image['image_height']
1012
  );
1013
  }
1014
- } elseif(!empty($data['comments']['picture'])){
1015
- $image = reset($data['comments']['picture']);
1016
- if(!empty($image['data'])){
1017
  $metadata['image'] = array(
1018
  'data' => $image['data'],
1019
  'mime' => $image['image_mime']
@@ -1031,65 +1048,65 @@ class GmediaCore{
1031
  *
1032
  * @return array|boolean Returns array of metadata, if found.
1033
  */
1034
- function wp_read_video_metadata($file){
1035
- if(!file_exists($file)){
1036
  return false;
1037
  }
1038
 
1039
  $metadata = array();
1040
 
1041
- if(!class_exists('getID3')){
1042
- require(ABSPATH . WPINC . '/ID3/getid3.php');
1043
  }
1044
- $id3 = new getID3();
1045
- $data = $id3->analyze($file);
1046
 
1047
- if(isset($data['video']['lossless'])){
1048
  $metadata['lossless'] = $data['video']['lossless'];
1049
  }
1050
- if(!empty($data['video']['bitrate'])){
1051
- $metadata['bitrate'] = (int)$data['video']['bitrate'];
1052
  }
1053
- if(!empty($data['video']['bitrate_mode'])){
1054
  $metadata['bitrate_mode'] = $data['video']['bitrate_mode'];
1055
  }
1056
- if(!empty($data['filesize'])){
1057
- $metadata['filesize'] = (int)$data['filesize'];
1058
  }
1059
- if(!empty($data['mime_type'])){
1060
  $metadata['mime_type'] = $data['mime_type'];
1061
  }
1062
- if(!empty($data['playtime_seconds'])){
1063
- $metadata['length'] = (int)ceil($data['playtime_seconds']);
1064
  }
1065
- if(!empty($data['playtime_string'])){
1066
  $metadata['length_formatted'] = $data['playtime_string'];
1067
  }
1068
- if(!empty($data['video']['resolution_x'])){
1069
- $metadata['width'] = (int)$data['video']['resolution_x'];
1070
  }
1071
- if(!empty($data['video']['resolution_y'])){
1072
- $metadata['height'] = (int)$data['video']['resolution_y'];
1073
  }
1074
- if(!empty($data['fileformat'])){
1075
  $metadata['fileformat'] = $data['fileformat'];
1076
  }
1077
- if(!empty($data['video']['dataformat'])){
1078
  $metadata['dataformat'] = $data['video']['dataformat'];
1079
  }
1080
- if(!empty($data['video']['encoder'])){
1081
  $metadata['encoder'] = $data['video']['encoder'];
1082
  }
1083
- if(!empty($data['video']['codec'])){
1084
  $metadata['codec'] = $data['video']['codec'];
1085
  }
1086
 
1087
- if(!empty($data['audio'])){
1088
- unset($data['audio']['streams']);
1089
  $metadata['audio'] = $data['audio'];
1090
  }
1091
 
1092
- $this->wp_add_id3_tag_data($metadata, $data);
1093
 
1094
  return $metadata;
1095
  }
@@ -1103,40 +1120,40 @@ class GmediaCore{
1103
  *
1104
  * @return array|boolean Returns array of metadata, if found.
1105
  */
1106
- function wp_read_audio_metadata($file){
1107
- if(!file_exists($file)){
1108
  return false;
1109
  }
1110
  $metadata = array();
1111
 
1112
- if(!class_exists('getID3')){
1113
- require(ABSPATH . WPINC . '/ID3/getid3.php');
1114
  }
1115
- $id3 = new getID3();
1116
- $data = $id3->analyze($file);
1117
 
1118
- if(!empty($data['audio'])){
1119
- unset($data['audio']['streams']);
1120
  $metadata = $data['audio'];
1121
  }
1122
 
1123
- if(!empty($data['fileformat'])){
1124
  $metadata['fileformat'] = $data['fileformat'];
1125
  }
1126
- if(!empty($data['filesize'])){
1127
- $metadata['filesize'] = (int)$data['filesize'];
1128
  }
1129
- if(!empty($data['mime_type'])){
1130
  $metadata['mime_type'] = $data['mime_type'];
1131
  }
1132
- if(!empty($data['playtime_seconds'])){
1133
- $metadata['length'] = (int)ceil($data['playtime_seconds']);
1134
  }
1135
- if(!empty($data['playtime_string'])){
1136
  $metadata['length_formatted'] = $data['playtime_string'];
1137
  }
1138
 
1139
- $this->wp_add_id3_tag_data($metadata, $data);
1140
 
1141
  return $metadata;
1142
  }
@@ -1145,149 +1162,187 @@ class GmediaCore{
1145
  /** Write the file
1146
  *
1147
  * @param string $file_tmp
1148
- * @param array $fileinfo
1149
  * @param string $content_type
1150
- * @param array $post_data
1151
  *
1152
  * @return array
1153
  */
1154
- function gmedia_upload_handler($file_tmp, $fileinfo, $content_type, $post_data){
1155
  global $gmGallery;
1156
  $cleanup_dir = true; // Remove old files
1157
- $file_age = 5 * 3600; // Temp file age in seconds
1158
- $chunk = (int)$this->_req('chunk', 0);
1159
- $chunks = (int)$this->_req('chunks', 0);
1160
 
1161
  // try to make grand-media dir if not exists
1162
- if(!wp_mkdir_p($fileinfo['dirpath'])){
1163
  $return = array(
1164
  "error" => array(
1165
- "code" => 100,
1166
- "message" => sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang'), $fileinfo['dirpath'])
1167
  ),
1168
- "id" => $fileinfo['basename']
1169
  );
1170
 
1171
  return $return;
1172
  }
1173
  // Check if grand-media dir is writable
1174
- if(!is_writable($fileinfo['dirpath'])){
1175
- @chmod($fileinfo['dirpath'], 0755);
1176
- if(!is_writable($fileinfo['dirpath'])){
1177
  $return = array(
1178
  "error" => array(
1179
- "code" => 100,
1180
- "message" => sprintf(__('Directory %s or its subfolders are not writable by the server.', 'gmLang'), dirname($fileinfo['dirpath']))
1181
  ),
1182
- "id" => $fileinfo['basename']
1183
  );
1184
 
1185
  return $return;
1186
  }
1187
  }
1188
  // Remove old temp files
1189
- if($cleanup_dir && is_dir($fileinfo['dirpath']) && ($_dir = opendir($fileinfo['dirpath']))){
1190
- while(($_file = readdir($_dir)) !== false){
1191
  $tmpfilePath = $fileinfo['dirpath'] . DIRECTORY_SEPARATOR . $_file;
1192
 
1193
  // Remove temp file if it is older than the max age and is not the current file
1194
- if(preg_match('/\.part$/', $_file) && (filemtime($tmpfilePath) < time() - $file_age) && ($tmpfilePath != $fileinfo['filepath'] . '.part')){
1195
- @unlink($tmpfilePath);
1196
  }
1197
  }
1198
 
1199
- closedir($_dir);
1200
- } else{
1201
  $return = array(
1202
- "error" => array("code" => 100, "message" => sprintf(__('Failed to open directory: %s', 'gmLang'), $fileinfo['dirpath'])),
1203
- "id" => $fileinfo['basename']
1204
  );
1205
 
1206
  return $return;
1207
  }
1208
 
1209
  // Open temp file
1210
- $out = fopen($fileinfo['filepath'] . '.part', $chunk == 0? "wb" : "ab");
1211
- if($out){
1212
  // Read binary input stream and append it to temp file
1213
- $in = fopen($file_tmp, "rb");
1214
 
1215
- if($in){
1216
- while(($buff = fread($in, 4096))){
1217
- fwrite($out, $buff);
1218
  }
1219
- } else{
1220
- $return = array("error" => array("code" => 101, "message" => __("Failed to open input stream.", 'gmLang')), "id" => $fileinfo['basename']);
1221
 
1222
  return $return;
1223
  }
1224
- fclose($in);
1225
- fclose($out);
1226
- if(strpos($content_type, "multipart") !== false){
1227
- @unlink($file_tmp);
1228
  }
1229
- if(!$chunks || $chunk == ($chunks - 1)){
1230
- sleep(1);
1231
  // Strip the temp .part suffix off
1232
- rename($fileinfo['filepath'] . '.part', $fileinfo['filepath']);
1233
 
1234
- $this->file_chmod($fileinfo['filepath']);
1235
 
1236
- $size = false;
1237
  $is_webimage = false;
1238
- if('image' == $fileinfo['dirname']){
1239
  /** WordPress Image Administration API */
1240
- require_once(ABSPATH . 'wp-admin/includes/image.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1241
 
1242
- $size = @getimagesize($fileinfo['filepath']);
1243
- if($size && file_is_displayable_image($fileinfo['filepath'])){
1244
- if(!wp_mkdir_p($fileinfo['dirpath_thumb'])){
 
 
 
 
1245
  $return = array(
1246
  "error" => array(
1247
- "code" => 100,
1248
- "message" => sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang'), $fileinfo['dirpath_thumb'])
1249
  ),
1250
- "id" => $fileinfo['basename']
1251
  );
1252
 
1253
  return $return;
1254
  }
1255
- if(!is_writable($fileinfo['dirpath_thumb'])){
1256
- @chmod($fileinfo['dirpath_thumb'], 0755);
1257
- if(!is_writable($fileinfo['dirpath_thumb'])){
1258
- @unlink($fileinfo['filepath']);
1259
  $return = array(
1260
  "error" => array(
1261
- "code" => 100,
1262
- "message" => sprintf(__('Directory %s is not writable by the server.', 'gmLang'), $fileinfo['dirpath_thumb'])
1263
  ),
1264
- "id" => $fileinfo['basename']
1265
  );
1266
 
1267
  return $return;
1268
  }
1269
  }
1270
- if(!wp_mkdir_p($fileinfo['dirpath_original'])){
1271
  $return = array(
1272
  "error" => array(
1273
- "code" => 100,
1274
- "message" => sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang'), $fileinfo['dirpath_original'])
1275
  ),
1276
- "id" => $fileinfo['basename']
1277
  );
1278
 
1279
  return $return;
1280
  }
1281
- if(!is_writable($fileinfo['dirpath_original'])){
1282
- @chmod($fileinfo['dirpath_original'], 0755);
1283
- if(!is_writable($fileinfo['dirpath_original'])){
1284
- @unlink($fileinfo['filepath']);
1285
  $return = array(
1286
  "error" => array(
1287
- "code" => 100,
1288
- "message" => sprintf(__('Directory %s is not writable by the server.', 'gmLang'), $fileinfo['dirpath_original'])
1289
  ),
1290
- "id" => $fileinfo['basename']
1291
  );
1292
 
1293
  return $return;
@@ -1295,53 +1350,53 @@ class GmediaCore{
1295
  }
1296
 
1297
  // Optimized image
1298
- $webimg = $gmGallery->options['image'];
1299
  $thumbimg = $gmGallery->options['thumb'];
1300
 
1301
- $webimg['resize'] = (($webimg['width'] < $size[0]) || ($webimg['height'] < $size[1]))? true : false;
1302
- $thumbimg['resize'] = (($thumbimg['width'] < $size[0]) || ($thumbimg['height'] < $size[1]))? true : false;
1303
 
1304
- if($webimg['resize']){
1305
- rename($fileinfo['filepath'], $fileinfo['filepath_original']);
1306
- } else{
1307
- copy($fileinfo['filepath'], $fileinfo['filepath_original']);
1308
  }
1309
 
1310
- if($webimg['resize'] || $thumbimg['resize']){
1311
- $editor = wp_get_image_editor($fileinfo['filepath_original']);
1312
- if(is_wp_error($editor)){
1313
- @unlink($fileinfo['filepath_original']);
1314
  $return = array(
1315
- "error" => array("code" => $editor->get_error_code(), "message" => $editor->get_error_message()),
1316
- "id" => $fileinfo['basename'],
1317
- "tip" => 'wp_get_image_editor'
1318
  );
1319
 
1320
  return $return;
1321
  }
1322
 
1323
- if($webimg['resize']){
1324
- $editor->set_quality($webimg['quality']);
1325
 
1326
- $resized = $editor->resize($webimg['width'], $webimg['height'], $webimg['crop']);
1327
- if(is_wp_error($resized)){
1328
- @unlink($fileinfo['filepath_original']);
1329
  $return = array(
1330
- "error" => array("code" => $resized->get_error_code(), "message" => $resized->get_error_message()),
1331
- "id" => $fileinfo['basename'],
1332
- "tip" => "editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})"
1333
  );
1334
 
1335
  return $return;
1336
  }
1337
 
1338
- $saved = $editor->save($fileinfo['filepath']);
1339
- if(is_wp_error($saved)){
1340
- @unlink($fileinfo['filepath_original']);
1341
  $return = array(
1342
- "error" => array("code" => $saved->get_error_code(), "message" => $saved->get_error_message()),
1343
- "id" => $fileinfo['basename'],
1344
- "tip" => 'editor->save->webimage'
1345
  );
1346
 
1347
  return $return;
@@ -1349,125 +1404,129 @@ class GmediaCore{
1349
  }
1350
 
1351
  // Thumbnail
1352
- $editor->set_quality($thumbimg['quality']);
1353
 
1354
- $resized = $editor->resize($thumbimg['width'], $thumbimg['height'], $thumbimg['crop']);
1355
- if(is_wp_error($resized)){
1356
- @unlink($fileinfo['filepath']);
1357
- @unlink($fileinfo['filepath_original']);
1358
  $return = array(
1359
- "error" => array("code" => $resized->get_error_code(), "message" => $resized->get_error_message()),
1360
- "id" => $fileinfo['basename'],
1361
- "tip" => "editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})"
1362
  );
1363
 
1364
  return $return;
1365
  }
1366
 
1367
- $saved = $editor->save($fileinfo['filepath_thumb']);
1368
- if(is_wp_error($saved)){
1369
- @unlink($fileinfo['filepath']);
1370
- @unlink($fileinfo['filepath_original']);
1371
  $return = array(
1372
- "error" => array("code" => $saved->get_error_code(), "message" => $saved->get_error_message()),
1373
- "id" => $fileinfo['basename'],
1374
- "tip" => 'editor->save->thumb'
1375
  );
1376
 
1377
  return $return;
1378
  }
1379
- } else{
1380
- copy($fileinfo['filepath'], $fileinfo['filepath_thumb']);
1381
  }
1382
  $is_webimage = true;
1383
- } else{
1384
- @unlink($fileinfo['filepath']);
1385
  $return = array(
1386
- "error" => array("code" => 104, "message" => __("Could not read image size. Invalid image was deleted.", 'gmLang')),
1387
- "id" => $fileinfo['basename']
1388
  );
1389
 
1390
  return $return;
1391
  }
1392
  }
1393
 
1394
- global $gmDB;
1395
-
1396
- // Write media data to DB
1397
- $title = '';
1398
- $description = '';
1399
- $link = '';
1400
- if(!isset($post_data['set_title'])){
1401
- $post_data['set_title'] = 'filename';
1402
- }
1403
- if(!isset($post_data['set_status'])){
1404
- $post_data['set_status'] = isset($post_data['status'])? $post_data['status'] : 'inherit';
1405
- }
1406
  // TODO Option to set title empty string or from metadata or from filename or both
1407
  // use image exif/iptc data for title and caption defaults if possible
1408
- if($size){
1409
- $image_meta = @wp_read_image_metadata($fileinfo['filepath_original']);
1410
- if(trim($image_meta['caption'])){
1411
  $description = $image_meta['caption'];
1412
  }
1413
- if('exif' == $post_data['set_title']) {
1414
- if (trim($image_meta['title']) && !is_numeric(sanitize_title($image_meta['title']))) {
1415
- $title = $image_meta['title'];
1416
- }
1417
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1418
  }
1419
- if(('empty' != $post_data['set_title']) && empty($title)) {
1420
- $title = $fileinfo['title'];
1421
- }
1422
-
1423
- $status = $post_data['set_status'];
1424
- if('inherit' == $post_data['set_status']){
1425
- $gmedia_album = isset($post_data['terms']['gmedia_album'])? $post_data['terms']['gmedia_album'] : false;
1426
- if($gmedia_album && $this->is_digit($gmedia_album)){
1427
- $album = $gmDB->get_term($gmedia_album, 'gmedia_album');
1428
- if(empty($album) || is_wp_error($album)){
1429
- $status = 'public';
1430
- } else{
1431
- $status = $album->status;
1432
- }
1433
- } else{
1434
- $status = 'public';
1435
- }
1436
- }
1437
-
1438
- unset($post_data['gmuid'], $post_data['mime_type'], $post_data['set_title'], $post_data['set_status']);
1439
- if(!$is_webimage && isset($post_data['terms']['gmedia_category'])){
1440
- unset($post_data['terms']['gmedia_category']);
1441
- }
1442
-
1443
- // Construct the media array
1444
  $media_data = array(
1445
- 'mime_type' => $fileinfo['mime_type'],
1446
- 'gmuid' => $fileinfo['basename'],
1447
- 'title' => $title,
1448
- 'link' => $link,
1449
  'description' => $description,
1450
- 'status' => $status
1451
  );
1452
- $media_data = wp_parse_args($post_data, $media_data);
 
 
 
 
1453
 
1454
  // Save the data
1455
- $id = $gmDB->insert_gmedia($media_data);
1456
- $gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_metadata', $gmDB->generate_gmedia_metadata($id, $fileinfo));
1457
 
1458
  $return = array(
1459
- "success" => array("code" => 200, "message" => sprintf(__('File uploaded successful. Assigned ID: %s', 'gmLang'), $id)),
1460
- "id" => $fileinfo['basename']
1461
  );
1462
 
1463
  return $return;
1464
- } else{
1465
- $return = array("success" => array("code" => 199, "message" => $chunk . '/' . $chunks), "id" => $fileinfo['basename']);
1466
 
1467
  return $return;
1468
  }
1469
- } else{
1470
- $return = array("error" => array("code" => 102, "message" => __("Failed to open output stream.", 'gmLang')), "id" => $fileinfo['basename']);
1471
 
1472
  return $return;
1473
  }
1
  <?php
2
+ if ( preg_match( '#' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
  /**
7
  * Main PHP class for the WordPress plugin GRAND Media
8
 
9
  */
10
+ class GmediaCore {
11
 
12
  var $upload;
13
  var $gmedia_url;
17
  /**
18
  *
19
  */
20
+ function __construct() {
21
+ $this->upload = $this->gm_upload_dir();
22
+ $this->gmedia_url = plugins_url( GMEDIA_FOLDER );
23
 
24
+ add_action( 'init', array( &$this, 'capabilities' ), 8 );
25
  }
26
 
27
+ function capabilities() {
 
28
  $capabilities = gmedia_plugin_capabilities();
29
+ $capabilities = apply_filters( 'gmedia_capabilities', $capabilities );
30
+ if(is_multisite() && is_super_admin()){
31
+ foreach ( $capabilities as $cap ) {
32
+ $this->caps[ $cap ] = 1;
33
+ }
34
+ } else {
35
+ $curuser = wp_get_current_user();
36
+ foreach ( $capabilities as $cap ) {
37
+ if ( isset( $curuser->allcaps[ $cap ] ) && intval( $curuser->allcaps[ $cap ] ) ) {
38
+ $this->caps[ $cap ] = 1;
39
+ } else {
40
+ $this->caps[ $cap ] = 0;
41
+ }
42
  }
43
  }
44
  }
47
  * Check GET data
48
  *
49
  * @param string $var
50
+ * @param mixed $def
51
  *
52
  * @return mixed
53
  */
54
+ function _get( $var = '', $def = false ) {
55
+ return isset( $_GET[ $var ] ) ? $_GET[ $var ] : $def;
56
  }
57
 
58
  /**
59
  * Check POST data
60
  *
61
+ * @param string $var
62
  * @param bool|mixed $def
63
  *
64
  * @return mixed
65
  */
66
 
67
+ function _post( $var = '', $def = false ) {
68
+ return isset( $_POST[ $var ] ) ? $_POST[ $var ] : $def;
69
  }
70
 
71
  /**
72
  * Check REQUEST data
73
  *
74
  * @param string $var
75
+ * @param bool $def
76
  *
77
  * @return mixed
78
  */
79
+ function _req( $var = '', $def = false ) {
80
+ return isset( $_REQUEST[ $var ] ) ? $_REQUEST[ $var ] : $def;
81
  }
82
 
83
  /**
84
  * tooltip()
85
  *
86
  * @param string $style 'tooltip', 'popover'
87
+ * @param array $params
88
+ * @param bool $print
89
  *
90
  * @return string
91
  */
92
+ function tooltip( $style, $params, $print = true ) {
93
  $show_tip = 0; // TODO show tooltips checkbox in settings
94
+ if ( $show_tip ) {
95
  $tooltip = " data-toggle='$style'";
96
+ if ( is_array( $params ) && ! empty( $params ) ) {
97
+ foreach ( $params as $key => $val ) {
98
  $tooltip .= " data-$key='$val'";
99
  }
100
  }
101
+ if ( $print ) {
102
  echo $tooltip;
103
+ } else {
104
  return $tooltip;
105
  }
106
  }
111
  /**
112
  * @param array $add_args
113
  * @param array $remove_args
114
+ * @param bool $uri
115
  *
116
  * @return string
117
  */
118
+ function get_admin_url( $add_args = array(), $remove_args = array(), $uri = false ) {
119
+ if ( true === $uri ) {
120
+ $uri = admin_url( 'admin.php' );
121
  }
122
+ $remove_args = array_unique( array_merge( array( 'doing_wp_cron', '_wpnonce', 'delete' ), $remove_args, array_keys( $add_args ) ) );
123
+ $new_uri = remove_query_arg( $remove_args, $uri );
124
+ if ( ! empty( $add_args ) ) {
125
+ $new_uri = add_query_arg( $add_args, $new_uri );
126
  }
127
 
128
  return $new_uri;
133
  *
134
  * @return bool
135
  */
136
+ function is_crawler( $userAgent ) {
137
+ $crawlers = 'Google|msnbot|Rambler|Yahoo|AbachoBOT|accoona|FeedBurner|' . 'AcioRobot|ASPSeek|CocoCrawler|Dumbot|FAST-WebCrawler|' . 'GeonaBot|Gigabot|Lycos|MSRBOT|Scooter|AltaVista|IDBot|eStyle|Scrubby|yandex|facebook';
138
+ $isCrawler = ( preg_match( "/$crawlers/i", $userAgent ) > 0 );
139
 
140
  return $isCrawler;
141
  }
145
  *
146
  * @return bool
147
  */
148
+ function is_browser( $userAgent ) {
149
+ $browsers = 'opera|aol|msie|firefox|chrome|konqueror|safari|netscape|navigator|mosaic|lynx|amaya|omniweb|avant|camino|flock|seamonkey|mozilla|gecko';
150
+ $isBrowser = ( preg_match( "/$browsers/i", $userAgent ) > 0 );
151
 
152
  return $isBrowser;
153
  }
168
  *
169
  * @return array See above for description.
170
  */
171
+ function gm_upload_dir( $create = true ) {
172
  $slash = '/';
173
  // If multisite (and if not the main site)
174
+ if ( is_multisite() && ! is_main_site() ) {
175
  $slash = '/blogs.dir/' . get_current_blog_id() . '/';
176
  }
177
 
178
  $dir = WP_CONTENT_DIR . $slash . GMEDIA_UPLOAD_FOLDER;
179
  $url = WP_CONTENT_URL . $slash . GMEDIA_UPLOAD_FOLDER;
180
 
181
+ $url = set_url_scheme($url);
182
 
183
+ $uploads = apply_filters( 'gm_upload_dir', array( 'path' => $dir, 'url' => $url, 'error' => false ) );
184
+
185
+ if ( $create ) {
186
  // Make sure we have an uploads dir
187
+ if ( ! wp_mkdir_p( $uploads['path'] ) ) {
188
+ $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $uploads['path'] );
189
  $uploads['error'] = $message;
190
  }
191
+ } elseif ( ! is_dir( $uploads['path'] ) ) {
192
  $uploads['error'] = true;
193
  }
194
 
200
  *
201
  * @return bool|null
202
  */
203
+ function delete_folder( $path ) {
204
+ $path = rtrim( $path, '/' );
205
+ if ( is_file( $path ) ) {
206
+ return @unlink( $path );
207
+ } elseif ( is_dir( $path ) ) {
208
+ $files = glob( $path . '/*', GLOB_NOSORT );
209
+ if ( ! empty( $files ) && is_array( $files ) ) {
210
+ array_map( array( $this, 'delete_folder' ), $files );
211
  }
212
 
213
+ return @rmdir( $path );
214
  }
215
 
216
  return null;
222
  * @see wp_get_attachment_image()
223
  * @uses apply_filters() Calls 'gm_get_attachment_image_attributes' hook on attributes array
224
  *
225
+ * @param int|object $item Image object.
226
+ * @param string $size Optional, default is empty string, could be 'thumb', 'original'
227
+ * @param bool $cover Optional, try to get cover url
228
  * @param bool|string $default Optional, return if no cover
229
  *
230
  * @return string img url
231
  */
232
+ function gm_get_media_image( $item, $size = '', $cover = true, $default = false ) {
233
  global $gmDB, $gmGallery;
234
 
235
+ if ( ! is_object( $item ) ) {
236
+ $item = $gmDB->get_gmedia( $item );
237
  }
238
+ $type = explode( '/', $item->mime_type );
239
 
240
+ if ( 'image' == $type[0] ) {
241
+ $type_folder = $this->upload['url'] . '/' . $gmGallery->options['folder'][ $type[0] ];
242
 
243
+ switch ( $size ) {
244
  case 'thumb':
245
  $size_folder = '/thumb/';
246
  break;
254
  }
255
 
256
  $image = $type_folder . $size_folder . $item->gmuid;
257
+ } else {
258
+ $ext = ltrim( strrchr( $item->gmuid, '.' ), '.' );
259
+ if ( ! $type = wp_ext2type( $ext ) ) {
260
  $type = 'application';
261
  }
262
  $image = $this->gmedia_url . '/admin/images/' . $type . '.png';
263
 
264
+ if ( $cover ) {
265
+ $cover = $gmDB->get_metadata( 'gmedia', $item->ID, 'cover', true );
266
+ if ( ! empty( $cover ) ) {
267
+ if ( $this->is_digit( $cover ) ) {
268
+ $image = $this->gm_get_media_image( (int) $cover, $size, false );
269
+ } elseif ( ( 'thumb' != $size ) && ( false !== filter_var( $cover, FILTER_VALIDATE_URL ) ) ) {
270
  return $cover;
271
  }
272
+ } elseif ( false !== $default ) {
273
  return $default;
274
  }
275
  }
285
  *
286
  * @return array|bool Return array( 'path', 'url' ) OR false if no module
287
  */
288
+ function get_module_path( $module_name ) {
289
  global $gmGallery;
290
+ if ( empty( $module_name ) ) {
291
  return false;
292
  }
293
  $module_dirs = array(
294
  'upload' => array(
295
  'path' => $this->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/' . $module_name,
296
+ 'url' => $this->upload['url'] . '/' . $gmGallery->options['folder']['module'] . '/' . $module_name
297
  ),
298
  'plugin' => array(
299
  'path' => GMEDIA_ABSPATH . 'module/' . $module_name,
300
+ 'url' => plugins_url( GMEDIA_FOLDER ) . '/module/' . $module_name
301
  ),
302
  );
303
+ foreach ( $module_dirs as $dir ) {
304
+ if ( is_dir( $dir['path'] ) ) {
305
  return $dir;
306
  }
307
  }
312
  /** Automatic choose upload directory based on media type
313
  *
314
  * @param string $file
315
+ * @param int $exists
316
  *
317
+ * @return array|bool
318
  */
319
+ function fileinfo( $file, $exists = 0 ) {
320
+ global $gmGallery, $user_ID;
321
+
322
+ $file = basename( $file );
323
+ $file_lower = strtolower( $file );
324
+ $filetype = wp_check_filetype( $file_lower, $mimes = null );
325
+ $title = pathinfo( $file, PATHINFO_FILENAME );
326
+ $pathinfo = pathinfo( preg_replace( '/[^a-z0-9_\.-]+/i', '_', $file ) );
327
+ $pathinfo['extension'] = strtolower( $pathinfo['extension'] );
328
+ $suffix = ( ( false !== $exists ) && absint( $exists ) ) ? "_$exists" : '';
329
+
330
+ $fileinfo['extension'] = ( empty( $filetype['ext'] ) ) ? $pathinfo['extension'] : $filetype['ext'];
331
+
332
+ $allowed_ext = get_allowed_mime_types( $user_ID );
333
+ $allowed_ext = array_keys( $allowed_ext );
334
+ $allowed_ext = implode( '|', $allowed_ext );
335
+ $allowed_ext = explode( '|', $allowed_ext );
336
+ if ( ! in_array( $fileinfo['extension'], $allowed_ext ) ) {
337
+ return false;
338
+ }
339
 
340
+ $fileinfo['filename'] = $pathinfo['filename'] . $suffix;
341
+ $fileinfo['basename'] = $fileinfo['filename'] . '.' . $fileinfo['extension'];
342
+ $fileinfo['title'] = ucwords( str_replace( '_', ' ', esc_sql( $title ) ) );
343
+ $fileinfo['mime_type'] = ( empty( $filetype['type'] ) ) ? 'application/' . $fileinfo['extension'] : $filetype['type'];
344
+ list( $dirname ) = explode( '/', $fileinfo['mime_type'] );
345
+ $fileinfo['dirname'] = $dirname;
346
+ $fileinfo['dirpath'] = $this->upload['path'] . '/' . $gmGallery->options['folder'][ $dirname ];
347
+ $fileinfo['dirurl'] = $this->upload['url'] . '/' . $gmGallery->options['folder'][ $dirname ];
348
+ $fileinfo['filepath'] = $fileinfo['dirpath'] . '/' . $fileinfo['basename'];
349
+ $fileinfo['fileurl'] = $fileinfo['dirurl'] . '/' . $fileinfo['basename'];
 
 
 
 
 
 
 
 
 
350
  $fileinfo['fileurl_original'] = $fileinfo['dirurl'] . '/' . $fileinfo['basename'];
351
+ if ( 'image' == $dirname ) {
352
+ $fileinfo['dirpath_original'] = $this->upload['path'] . '/' . $gmGallery->options['folder']['image_original'];
353
+ $fileinfo['dirurl_original'] = $this->upload['url'] . '/' . $gmGallery->options['folder']['image_original'];
354
  $fileinfo['filepath_original'] = $fileinfo['dirpath_original'] . '/' . $fileinfo['basename'];
355
+ $fileinfo['fileurl_original'] = $fileinfo['dirurl_original'] . '/' . $fileinfo['basename'];
356
+ $fileinfo['dirpath_thumb'] = $this->upload['path'] . '/' . $gmGallery->options['folder']['image_thumb'];
357
+ $fileinfo['dirurl_thumb'] = $this->upload['url'] . '/' . $gmGallery->options['folder']['image_thumb'];
358
+ $fileinfo['filepath_thumb'] = $fileinfo['dirpath_thumb'] . '/' . $fileinfo['basename'];
359
+ $fileinfo['fileurl_thumb'] = $fileinfo['dirurl_thumb'] . '/' . $fileinfo['basename'];
360
  }
361
 
362
+ if ( ( false !== $exists ) && file_exists( $fileinfo['filepath'] ) ) {
363
+ $exists = absint( $exists ) + 1;
364
+ $fileinfo = $this->fileinfo( $file, $exists );
365
  }
366
 
367
  return $fileinfo;
371
  *
372
  * @param string $new_file
373
  */
374
+ function file_chmod( $new_file ) {
375
+ $stat = stat( dirname( $new_file ) );
376
  $perms = $stat['mode'] & 0000666;
377
+ @chmod( $new_file, $perms );
378
  }
379
 
380
  /**
384
  *
385
  * @return mixed
386
  */
387
+ function clean_input( $input ) {
388
  $search = array(
389
  /*'@<[\/\!]*?[^<>]*?>@si'*/ /* Strip out HTML tags */
390
  '@<script[^>]*?>.*?</script>@si' /* Strip out javascript */,
393
  //,'/\s{3,}/'
394
  );
395
 
396
+ $output = preg_replace( $search, '', $input );
397
 
398
  return $output;
399
  }
405
  *
406
  * @return mixed
407
  */
408
+ function sanitize( $input ) {
409
  $output = $input;
410
+ if ( is_array( $input ) ) {
411
+ foreach ( $input as $var => $val ) {
412
+ $output[ $var ] = $this->sanitize( $val );
413
  }
414
+ } else {
415
+ if ( get_magic_quotes_gpc() ) {
416
+ $input = stripslashes( $input );
417
  }
418
+ $input = $this->clean_input( $input );
419
+ $output = esc_sql( $input );
420
  }
421
 
422
  return $output;
429
  *
430
  * @return bool
431
  */
432
+ function is_digit( $digit ) {
433
+ if ( is_int( $digit ) ) {
434
  return true;
435
+ } elseif ( is_string( $digit ) && ! empty( $digit ) ) {
436
+ return ctype_digit( $digit );
437
+ } else {
438
  // booleans, floats and others
439
  return false;
440
  }
445
  *
446
  * @return array
447
  */
448
+ function get_editable_user_ids() {
449
+ if ( current_user_can( 'gmedia_show_others_media' ) || current_user_can( 'gmedia_edit_others_media' ) ) {
450
+ return get_users( array( 'who' => 'authors', 'fields' => 'ID' ) );
451
  }
452
 
453
  return get_current_user_id();
461
  *
462
  * @return string
463
  */
464
+ function filesize( $file, $decimals = 2 ) {
465
+ $bytes = filesize( $file );
466
+ $sz = array( 'b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb' );
467
+ $factor = (int) floor( ( strlen( $bytes ) - 1 ) / 3 );
468
 
469
+ return sprintf( "%.{$decimals}f", $bytes / pow( 1024, $factor ) ) . $sz[ $factor ];
470
  }
471
 
472
  /**
473
  * @author Gajus Kuizinas <g.kuizinas@anuary.com>
474
  * @version 1.0.0 (2013 03 19)
475
  */
476
+ function array_diff_key_recursive( array $arr1, array $arr2 ) {
477
+ $diff = array_diff_key( $arr1, $arr2 );
478
+ $intersect = array_intersect_key( $arr1, $arr2 );
479
 
480
+ foreach ( $intersect as $k => $v ) {
481
+ if ( is_array( $arr1[ $k ] ) && is_array( $arr2[ $k ] ) ) {
482
+ $d = $this->array_diff_key_recursive( $arr1[ $k ], $arr2[ $k ] );
483
 
484
+ if ( ! empty( $d ) ) {
485
+ $diff[ $k ] = $d;
486
  }
487
  }
488
  }
493
  /**
494
  * @param array $arr1
495
  * @param array $arr2
496
+ * @param bool $update
497
  *
498
  * @return array
499
  */
500
+ function array_diff_keyval_recursive( array $arr1, array $arr2, $update = false ) {
501
+ $diff = array_diff_key( $arr1, $arr2 );
502
+ $intersect = array_intersect_key( $arr1, $arr2 );
503
 
504
+ foreach ( $intersect as $k => $v ) {
505
+ if ( is_array( $arr1[ $k ] ) && is_array( $arr2[ $k ] ) ) {
506
+ $d = $this->array_diff_keyval_recursive( $arr1[ $k ], $arr2[ $k ], $update );
507
 
508
+ if ( ! empty( $d ) ) {
509
+ $diff[ $k ] = $d;
510
  }
511
+ } elseif ( $arr1[ $k ] !== $arr2[ $k ] ) {
512
+ if ( $update ) {
513
+ $diff[ $k ] = $arr2[ $k ];
514
+ } else {
515
+ $diff[ $k ] = $arr1[ $k ];
516
  }
517
  }
518
  }
526
  *
527
  * @return mixed
528
  */
529
+ function array_replace_recursive( $base, $replacements ) {
530
+ if ( function_exists( 'array_replace_recursive' ) ) {
531
+ return array_replace_recursive( $base, $replacements );
532
  }
533
 
534
+ foreach ( array_slice( func_get_args(), 1 ) as $replacements ) {
535
+ $bref_stack = array( &$base );
536
+ $head_stack = array( $replacements );
537
 
538
+ do {
539
+ end( $bref_stack );
540
 
541
+ $bref = &$bref_stack[ key( $bref_stack ) ];
542
+ $head = array_pop( $head_stack );
543
 
544
+ unset( $bref_stack[ key( $bref_stack ) ] );
545
 
546
+ foreach ( array_keys( $head ) as $key ) {
547
+ if ( isset( $key, $bref ) && is_array( $bref[ $key ] ) && is_array( $head[ $key ] ) ) {
548
+ $bref_stack[] = &$bref[ $key ];
549
+ $head_stack[] = $head[ $key ];
550
+ } else {
551
+ $bref[ $key ] = $head[ $key ];
552
  }
553
  }
554
+ } while ( count( $head_stack ) );
555
  }
556
 
557
  return $base;
562
  *
563
  * @return array|bool
564
  */
565
+ function process_gmedit_image( $photo ) {
566
  $type = null;
567
+ if ( preg_match( '/^data:image\/(jpg|jpeg|png|gif)/i', $photo, $matches ) ) {
568
  $type = $matches[1];
569
+ } else {
570
  return false;
571
  }
572
  // Remove the mime-type header
573
+ $data = explode( 'base64,', $photo );
574
+ $data = array_reverse( $data );
575
+ $data = reset( $data );
576
 
577
  // Use strict mode to prevent characters from outside the base64 range
578
+ $image = base64_decode( $data, true );
579
 
580
+ if ( ! $image ) {
581
  return false;
582
  }
583
 
590
  /**
591
  * @return bool
592
  */
593
+ function is_bot() {
594
+ if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
595
+ return false;
596
+ }
597
 
598
  $spiders = array(
599
  "abot",
982
  "...."
983
  );
984
 
985
+ foreach ( $spiders as $spider ) {
986
  //If the spider text is found in the current user agent, then return true
987
+ if ( stripos( $_SERVER['HTTP_USER_AGENT'], $spider ) !== false ) {
988
  return true;
989
  break;
990
  }
1000
  * @since 3.6.0
1001
  *
1002
  * @param array $metadata An existing array with data
1003
+ * @param array $data Data supplied by ID3 tags
1004
  */
1005
+ function wp_add_id3_tag_data( &$metadata, $data ) {
1006
+ foreach ( array( 'id3v2', 'id3v1' ) as $version ) {
1007
+ if ( ! empty( $data[ $version ]['comments'] ) ) {
1008
+ foreach ( $data[ $version ]['comments'] as $key => $list ) {
1009
+ if ( ! empty( $list ) ) {
1010
+ $metadata[ $key ] = reset( $list );
1011
  // fix bug in byte stream analysis
1012
+ if ( 'terms_of_use' === $key && 0 === strpos( $metadata[ $key ], 'yright notice.' ) ) {
1013
+ $metadata[ $key ] = 'Cop' . $metadata[ $key ];
1014
  }
1015
  }
1016
  }
1018
  }
1019
  }
1020
 
1021
+ if ( ! empty( $data['id3v2']['APIC'] ) ) {
1022
+ $image = reset( $data['id3v2']['APIC'] );
1023
+ if ( ! empty( $image['data'] ) ) {
1024
  $metadata['image'] = array(
1025
+ 'data' => $image['data'],
1026
+ 'mime' => $image['image_mime'],
1027
+ 'width' => $image['image_width'],
1028
  'height' => $image['image_height']
1029
  );
1030
  }
1031
+ } elseif ( ! empty( $data['comments']['picture'] ) ) {
1032
+ $image = reset( $data['comments']['picture'] );
1033
+ if ( ! empty( $image['data'] ) ) {
1034
  $metadata['image'] = array(
1035
  'data' => $image['data'],
1036
  'mime' => $image['image_mime']
1048
  *
1049
  * @return array|boolean Returns array of metadata, if found.
1050
  */
1051
+ function wp_read_video_metadata( $file ) {
1052
+ if ( ! file_exists( $file ) ) {
1053
  return false;
1054
  }
1055
 
1056
  $metadata = array();
1057
 
1058
+ if ( ! class_exists( 'getID3' ) ) {
1059
+ require( ABSPATH . WPINC . '/ID3/getid3.php' );
1060
  }
1061
+ $id3 = new getID3();
1062
+ $data = $id3->analyze( $file );
1063
 
1064
+ if ( isset( $data['video']['lossless'] ) ) {
1065
  $metadata['lossless'] = $data['video']['lossless'];
1066
  }
1067
+ if ( ! empty( $data['video']['bitrate'] ) ) {
1068
+ $metadata['bitrate'] = (int) $data['video']['bitrate'];
1069
  }
1070
+ if ( ! empty( $data['video']['bitrate_mode'] ) ) {
1071
  $metadata['bitrate_mode'] = $data['video']['bitrate_mode'];
1072
  }
1073
+ if ( ! empty( $data['filesize'] ) ) {
1074
+ $metadata['filesize'] = (int) $data['filesize'];
1075
  }
1076
+ if ( ! empty( $data['mime_type'] ) ) {
1077
  $metadata['mime_type'] = $data['mime_type'];
1078
  }
1079
+ if ( ! empty( $data['playtime_seconds'] ) ) {
1080
+ $metadata['length'] = (int) ceil( $data['playtime_seconds'] );
1081
  }
1082
+ if ( ! empty( $data['playtime_string'] ) ) {
1083
  $metadata['length_formatted'] = $data['playtime_string'];
1084
  }
1085
+ if ( ! empty( $data['video']['resolution_x'] ) ) {
1086
+ $metadata['width'] = (int) $data['video']['resolution_x'];
1087
  }
1088
+ if ( ! empty( $data['video']['resolution_y'] ) ) {
1089
+ $metadata['height'] = (int) $data['video']['resolution_y'];
1090
  }
1091
+ if ( ! empty( $data['fileformat'] ) ) {
1092
  $metadata['fileformat'] = $data['fileformat'];
1093
  }
1094
+ if ( ! empty( $data['video']['dataformat'] ) ) {
1095
  $metadata['dataformat'] = $data['video']['dataformat'];
1096
  }
1097
+ if ( ! empty( $data['video']['encoder'] ) ) {
1098
  $metadata['encoder'] = $data['video']['encoder'];
1099
  }
1100
+ if ( ! empty( $data['video']['codec'] ) ) {
1101
  $metadata['codec'] = $data['video']['codec'];
1102
  }
1103
 
1104
+ if ( ! empty( $data['audio'] ) ) {
1105
+ unset( $data['audio']['streams'] );
1106
  $metadata['audio'] = $data['audio'];
1107
  }
1108
 
1109
+ $this->wp_add_id3_tag_data( $metadata, $data );
1110
 
1111
  return $metadata;
1112
  }
1120
  *
1121
  * @return array|boolean Returns array of metadata, if found.
1122
  */
1123
+ function wp_read_audio_metadata( $file ) {
1124
+ if ( ! file_exists( $file ) ) {
1125
  return false;
1126
  }
1127
  $metadata = array();
1128
 
1129
+ if ( ! class_exists( 'getID3' ) ) {
1130
+ require( ABSPATH . WPINC . '/ID3/getid3.php' );
1131
  }
1132
+ $id3 = new getID3();
1133
+ $data = $id3->analyze( $file );
1134
 
1135
+ if ( ! empty( $data['audio'] ) ) {
1136
+ unset( $data['audio']['streams'] );
1137
  $metadata = $data['audio'];
1138
  }
1139
 
1140
+ if ( ! empty( $data['fileformat'] ) ) {
1141
  $metadata['fileformat'] = $data['fileformat'];
1142
  }
1143
+ if ( ! empty( $data['filesize'] ) ) {
1144
+ $metadata['filesize'] = (int) $data['filesize'];
1145
  }
1146
+ if ( ! empty( $data['mime_type'] ) ) {
1147
  $metadata['mime_type'] = $data['mime_type'];
1148
  }
1149
+ if ( ! empty( $data['playtime_seconds'] ) ) {
1150
+ $metadata['length'] = (int) ceil( $data['playtime_seconds'] );
1151
  }
1152
+ if ( ! empty( $data['playtime_string'] ) ) {
1153
  $metadata['length_formatted'] = $data['playtime_string'];
1154
  }
1155
 
1156
+ $this->wp_add_id3_tag_data( $metadata, $data );
1157
 
1158
  return $metadata;
1159
  }
1162
  /** Write the file
1163
  *
1164
  * @param string $file_tmp
1165
+ * @param array $fileinfo
1166
  * @param string $content_type
1167
+ * @param array $post_data
1168
  *
1169
  * @return array
1170
  */
1171
+ function gmedia_upload_handler( $file_tmp, $fileinfo, $content_type, $post_data ) {
1172
  global $gmGallery;
1173
  $cleanup_dir = true; // Remove old files
1174
+ $file_age = 5 * 3600; // Temp file age in seconds
1175
+ $chunk = (int) $this->_req( 'chunk', 0 );
1176
+ $chunks = (int) $this->_req( 'chunks', 0 );
1177
 
1178
  // try to make grand-media dir if not exists
1179
+ if ( ! wp_mkdir_p( $fileinfo['dirpath'] ) ) {
1180
  $return = array(
1181
  "error" => array(
1182
+ "code" => 100,
1183
+ "message" => sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang' ), $fileinfo['dirpath'] )
1184
  ),
1185
+ "id" => $fileinfo['basename']
1186
  );
1187
 
1188
  return $return;
1189
  }
1190
  // Check if grand-media dir is writable
1191
+ if ( ! is_writable( $fileinfo['dirpath'] ) ) {
1192
+ @chmod( $fileinfo['dirpath'], 0755 );
1193
+ if ( ! is_writable( $fileinfo['dirpath'] ) ) {
1194
  $return = array(
1195
  "error" => array(
1196
+ "code" => 100,
1197
+ "message" => sprintf( __( 'Directory %s or its subfolders are not writable by the server.', 'gmLang' ), dirname( $fileinfo['dirpath'] ) )
1198
  ),
1199
+ "id" => $fileinfo['basename']
1200
  );
1201
 
1202
  return $return;
1203
  }
1204
  }
1205
  // Remove old temp files
1206
+ if ( $cleanup_dir && is_dir( $fileinfo['dirpath'] ) && ( $_dir = opendir( $fileinfo['dirpath'] ) ) ) {
1207
+ while ( ( $_file = readdir( $_dir ) ) !== false ) {
1208
  $tmpfilePath = $fileinfo['dirpath'] . DIRECTORY_SEPARATOR . $_file;
1209
 
1210
  // Remove temp file if it is older than the max age and is not the current file
1211
+ if ( preg_match( '/\.part$/', $_file ) && ( filemtime( $tmpfilePath ) < time() - $file_age ) && ( $tmpfilePath != $fileinfo['filepath'] . '.part' ) ) {
1212
+ @unlink( $tmpfilePath );
1213
  }
1214
  }
1215
 
1216
+ closedir( $_dir );
1217
+ } else {
1218
  $return = array(
1219
+ "error" => array( "code" => 100, "message" => sprintf( __( 'Failed to open directory: %s', 'gmLang' ), $fileinfo['dirpath'] ) ),
1220
+ "id" => $fileinfo['basename']
1221
  );
1222
 
1223
  return $return;
1224
  }
1225
 
1226
  // Open temp file
1227
+ $out = fopen( $fileinfo['filepath'] . '.part', $chunk == 0 ? "wb" : "ab" );
1228
+ if ( $out ) {
1229
  // Read binary input stream and append it to temp file
1230
+ $in = fopen( $file_tmp, "rb" );
1231
 
1232
+ if ( $in ) {
1233
+ while ( ( $buff = fread( $in, 4096 ) ) ) {
1234
+ fwrite( $out, $buff );
1235
  }
1236
+ } else {
1237
+ $return = array( "error" => array( "code" => 101, "message" => __( "Failed to open input stream.", 'gmLang' ) ), "id" => $fileinfo['basename'] );
1238
 
1239
  return $return;
1240
  }
1241
+ fclose( $in );
1242
+ fclose( $out );
1243
+ if ( strpos( $content_type, "multipart" ) !== false ) {
1244
+ @unlink( $file_tmp );
1245
  }
1246
+ if ( ! $chunks || $chunk == ( $chunks - 1 ) ) {
1247
+ sleep( 1 );
1248
  // Strip the temp .part suffix off
1249
+ rename( $fileinfo['filepath'] . '.part', $fileinfo['filepath'] );
1250
 
1251
+ $this->file_chmod( $fileinfo['filepath'] );
1252
 
1253
+ $size = false;
1254
  $is_webimage = false;
1255
+ if ( 'image' == $fileinfo['dirname'] ) {
1256
  /** WordPress Image Administration API */
1257
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
1258
+
1259
+ $size = @getimagesize( $fileinfo['filepath'] );
1260
+ if ( $size && file_is_displayable_image( $fileinfo['filepath'] ) ) {
1261
+
1262
+ if ( function_exists( 'memory_get_usage' ) ) {
1263
+ $extensions = array( '1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP' );
1264
+ switch ( $extensions[ $size[2] ] ) {
1265
+ case 'GIF':
1266
+ $CHANNEL = 1;
1267
+ break;
1268
+ case 'JPG':
1269
+ $CHANNEL = $size['channels'];
1270
+ break;
1271
+ case 'PNG':
1272
+ $CHANNEL = 3;
1273
+ break;
1274
+ case 'BMP':
1275
+ default:
1276
+ $CHANNEL = 6;
1277
+ break;
1278
+ }
1279
+ $MB = 1048576; // number of bytes in 1M
1280
+ $K64 = 65536; // number of bytes in 64K
1281
+ $TWEAKFACTOR = 1.8; // Or whatever works for you
1282
+ $memoryNeeded = round( ( $size[0] * $size[1] * $size['bits'] * $CHANNEL / 8 + $K64 ) * $TWEAKFACTOR );
1283
+ $memoryNeeded = memory_get_usage() + $memoryNeeded;
1284
+ $current_limit = @ini_get( 'memory_limit' );
1285
+ $current_limit_int = intval( $current_limit );
1286
+ if ( false !== strpos( $current_limit, 'M' ) ) {
1287
+ $current_limit_int *= $MB;
1288
+ }
1289
+ if ( false !== strpos( $current_limit, 'G' ) ) {
1290
+ $current_limit_int *= 1024;
1291
+ }
1292
 
1293
+ if ( - 1 != $current_limit && $memoryNeeded > $current_limit_int ) {
1294
+ $newLimit = $current_limit_int / $MB + ceil( ( $memoryNeeded - $current_limit_int ) / $MB );
1295
+ @ini_set( 'memory_limit', $newLimit . 'M' );
1296
+ }
1297
+ }
1298
+
1299
+ if ( ! wp_mkdir_p( $fileinfo['dirpath_thumb'] ) ) {
1300
  $return = array(
1301
  "error" => array(
1302
+ "code" => 100,
1303
+ "message" => sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang' ), $fileinfo['dirpath_thumb'] )
1304
  ),
1305
+ "id" => $fileinfo['basename']
1306
  );
1307
 
1308
  return $return;
1309
  }
1310
+ if ( ! is_writable( $fileinfo['dirpath_thumb'] ) ) {
1311
+ @chmod( $fileinfo['dirpath_thumb'], 0755 );
1312
+ if ( ! is_writable( $fileinfo['dirpath_thumb'] ) ) {
1313
+ @unlink( $fileinfo['filepath'] );
1314
  $return = array(
1315
  "error" => array(
1316
+ "code" => 100,
1317
+ "message" => sprintf( __( 'Directory %s is not writable by the server.', 'gmLang' ), $fileinfo['dirpath_thumb'] )
1318
  ),
1319
+ "id" => $fileinfo['basename']
1320
  );
1321
 
1322
  return $return;
1323
  }
1324
  }
1325
+ if ( ! wp_mkdir_p( $fileinfo['dirpath_original'] ) ) {
1326
  $return = array(
1327
  "error" => array(
1328
+ "code" => 100,
1329
+ "message" => sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?', 'gmLang' ), $fileinfo['dirpath_original'] )
1330
  ),
1331
+ "id" => $fileinfo['basename']
1332
  );
1333
 
1334
  return $return;
1335
  }
1336
+ if ( ! is_writable( $fileinfo['dirpath_original'] ) ) {
1337
+ @chmod( $fileinfo['dirpath_original'], 0755 );
1338
+ if ( ! is_writable( $fileinfo['dirpath_original'] ) ) {
1339
+ @unlink( $fileinfo['filepath'] );
1340
  $return = array(
1341
  "error" => array(
1342
+ "code" => 100,
1343
+ "message" => sprintf( __( 'Directory %s is not writable by the server.', 'gmLang' ), $fileinfo['dirpath_original'] )
1344
  ),
1345
+ "id" => $fileinfo['basename']
1346
  );
1347
 
1348
  return $return;
1350
  }
1351
 
1352
  // Optimized image
1353
+ $webimg = $gmGallery->options['image'];
1354
  $thumbimg = $gmGallery->options['thumb'];
1355
 
1356
+ $webimg['resize'] = ( ( $webimg['width'] < $size[0] ) || ( $webimg['height'] < $size[1] ) ) ? true : false;
1357
+ $thumbimg['resize'] = ( ( $thumbimg['width'] < $size[0] ) || ( $thumbimg['height'] < $size[1] ) ) ? true : false;
1358
 
1359
+ if ( $webimg['resize'] ) {
1360
+ rename( $fileinfo['filepath'], $fileinfo['filepath_original'] );
1361
+ } else {
1362
+ copy( $fileinfo['filepath'], $fileinfo['filepath_original'] );
1363
  }
1364
 
1365
+ if ( $webimg['resize'] || $thumbimg['resize'] ) {
1366
+ $editor = wp_get_image_editor( $fileinfo['filepath_original'] );
1367
+ if ( is_wp_error( $editor ) ) {
1368
+ @unlink( $fileinfo['filepath_original'] );
1369
  $return = array(
1370
+ "error" => array( "code" => $editor->get_error_code(), "message" => $editor->get_error_message() ),
1371
+ "id" => $fileinfo['basename'],
1372
+ "tip" => 'wp_get_image_editor'
1373
  );
1374
 
1375
  return $return;
1376
  }
1377
 
1378
+ if ( $webimg['resize'] ) {
1379
+ $editor->set_quality( $webimg['quality'] );
1380
 
1381
+ $resized = $editor->resize( $webimg['width'], $webimg['height'], $webimg['crop'] );
1382
+ if ( is_wp_error( $resized ) ) {
1383
+ @unlink( $fileinfo['filepath_original'] );
1384
  $return = array(
1385
+ "error" => array( "code" => $resized->get_error_code(), "message" => $resized->get_error_message() ),
1386
+ "id" => $fileinfo['basename'],
1387
+ "tip" => "editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})"
1388
  );
1389
 
1390
  return $return;
1391
  }
1392
 
1393
+ $saved = $editor->save( $fileinfo['filepath'] );
1394
+ if ( is_wp_error( $saved ) ) {
1395
+ @unlink( $fileinfo['filepath_original'] );
1396
  $return = array(
1397
+ "error" => array( "code" => $saved->get_error_code(), "message" => $saved->get_error_message() ),
1398
+ "id" => $fileinfo['basename'],
1399
+ "tip" => 'editor->save->webimage'
1400
  );
1401
 
1402
  return $return;
1404
  }
1405
 
1406
  // Thumbnail
1407
+ $editor->set_quality( $thumbimg['quality'] );
1408
 
1409
+ $resized = $editor->resize( $thumbimg['width'], $thumbimg['height'], $thumbimg['crop'] );
1410
+ if ( is_wp_error( $resized ) ) {
1411
+ @unlink( $fileinfo['filepath'] );
1412
+ @unlink( $fileinfo['filepath_original'] );
1413
  $return = array(
1414
+ "error" => array( "code" => $resized->get_error_code(), "message" => $resized->get_error_message() ),
1415
+ "id" => $fileinfo['basename'],
1416
+ "tip" => "editor->resize->thumb({$thumbimg['width']}, {$thumbimg['height']}, {$thumbimg['crop']})"
1417
  );
1418
 
1419
  return $return;
1420
  }
1421
 
1422
+ $saved = $editor->save( $fileinfo['filepath_thumb'] );
1423
+ if ( is_wp_error( $saved ) ) {
1424
+ @unlink( $fileinfo['filepath'] );
1425
+ @unlink( $fileinfo['filepath_original'] );
1426
  $return = array(
1427
+ "error" => array( "code" => $saved->get_error_code(), "message" => $saved->get_error_message() ),
1428
+ "id" => $fileinfo['basename'],
1429
+ "tip" => 'editor->save->thumb'
1430
  );
1431
 
1432
  return $return;
1433
  }
1434
+ } else {
1435
+ copy( $fileinfo['filepath'], $fileinfo['filepath_thumb'] );
1436
  }
1437
  $is_webimage = true;
1438
+ } else {
1439
+ @unlink( $fileinfo['filepath'] );
1440
  $return = array(
1441
+ "error" => array( "code" => 104, "message" => __( "Could not read image size. Invalid image was deleted.", 'gmLang' ) ),
1442
+ "id" => $fileinfo['basename']
1443
  );
1444
 
1445
  return $return;
1446
  }
1447
  }
1448
 
1449
+ global $gmDB;
1450
+
1451
+ // Write media data to DB
1452
+ $title = '';
1453
+ $description = '';
1454
+ $link = '';
1455
+ if ( ! isset( $post_data['set_title'] ) ) {
1456
+ $post_data['set_title'] = 'filename';
1457
+ }
1458
+ if ( ! isset( $post_data['set_status'] ) ) {
1459
+ $post_data['set_status'] = isset( $post_data['status'] ) ? $post_data['status'] : 'inherit';
1460
+ }
1461
  // TODO Option to set title empty string or from metadata or from filename or both
1462
  // use image exif/iptc data for title and caption defaults if possible
1463
+ if ( $size ) {
1464
+ $image_meta = @wp_read_image_metadata( $fileinfo['filepath_original'] );
1465
+ if ( trim( $image_meta['caption'] ) ) {
1466
  $description = $image_meta['caption'];
1467
  }
1468
+ if ( 'exif' == $post_data['set_title'] ) {
1469
+ if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
1470
+ $title = $image_meta['title'];
1471
+ }
1472
+ }
1473
+ }
1474
+ if ( ( 'empty' != $post_data['set_title'] ) && empty( $title ) ) {
1475
+ $title = $fileinfo['title'];
1476
+ }
1477
+
1478
+ $status = $post_data['set_status'];
1479
+ if ( 'inherit' == $post_data['set_status'] ) {
1480
+ $gmedia_album = isset( $post_data['terms']['gmedia_album'] ) ? $post_data['terms']['gmedia_album'] : false;
1481
+ if ( $gmedia_album && $this->is_digit( $gmedia_album ) ) {
1482
+ $album = $gmDB->get_term( $gmedia_album, 'gmedia_album' );
1483
+ if ( empty( $album ) || is_wp_error( $album ) ) {
1484
+ $status = 'public';
1485
+ } else {
1486
+ $status = $album->status;
1487
+ }
1488
+ } else {
1489
+ $status = 'public';
1490
+ }
1491
+ }
1492
+
1493
+ unset( $post_data['gmuid'], $post_data['mime_type'], $post_data['set_title'], $post_data['set_status'] );
1494
+ if ( ! $is_webimage && isset( $post_data['terms']['gmedia_category'] ) ) {
1495
+ unset( $post_data['terms']['gmedia_category'] );
1496
  }
1497
+
1498
+ // Construct the media array
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1499
  $media_data = array(
1500
+ 'mime_type' => $fileinfo['mime_type'],
1501
+ 'gmuid' => $fileinfo['basename'],
1502
+ 'title' => $title,
1503
+ 'link' => $link,
1504
  'description' => $description,
1505
+ 'status' => $status
1506
  );
1507
+ $media_data = wp_parse_args( $post_data, $media_data );
1508
+ if ( ! current_user_can( 'gmedia_delete_others_media' ) ) {
1509
+ $media_data['author'] = get_current_user_id();
1510
+ }
1511
+
1512
 
1513
  // Save the data
1514
+ $id = $gmDB->insert_gmedia( $media_data );
1515
+ $gmDB->update_metadata( $meta_type = 'gmedia', $id, $meta_key = '_metadata', $gmDB->generate_gmedia_metadata( $id, $fileinfo ) );
1516
 
1517
  $return = array(
1518
+ "success" => array( "code" => 200, "message" => sprintf( __( 'File uploaded successful. Assigned ID: %s', 'gmLang' ), $id ) ),
1519
+ "id" => $fileinfo['basename']
1520
  );
1521
 
1522
  return $return;
1523
+ } else {
1524
+ $return = array( "success" => array( "code" => 199, "message" => $chunk . '/' . $chunks ), "id" => $fileinfo['basename'] );
1525
 
1526
  return $return;
1527
  }
1528
+ } else {
1529
+ $return = array( "error" => array( "code" => 102, "message" => __( "Failed to open output stream.", 'gmLang' ) ), "id" => $fileinfo['basename'] );
1530
 
1531
  return $return;
1532
  }
inc/db.connect.php CHANGED
@@ -2087,7 +2087,7 @@ class GmediaDB{
2087
  */
2088
  function get_term($term, $taxonomy, $output = OBJECT){
2089
  /** @var $wpdb wpdb */
2090
- global $wpdb;
2091
  $null = null;
2092
 
2093
  if(empty($term)){
@@ -2106,15 +2106,25 @@ class GmediaDB{
2106
  if(is_object($term)){
2107
  $term = $term->term_id;
2108
  }
2109
- if(!$term = (int)$term){
2110
- return $null;
2111
- }
2112
- if(!$_term = wp_cache_get($term, $taxonomy)){
2113
- $_term = $wpdb->get_row($wpdb->prepare("SELECT t.* FROM {$wpdb->prefix}gmedia_term AS t WHERE t.taxonomy = %s AND t.term_id = %d LIMIT 1", $taxonomy, $term));
2114
- if(!$_term){
 
 
2115
  return $null;
2116
  }
2117
- wp_cache_add($term, $_term, $taxonomy);
 
 
 
 
 
 
 
 
2118
  }
2119
 
2120
  $_term = apply_filters('get_gmedia_term', $_term, $taxonomy);
@@ -2194,6 +2204,8 @@ class GmediaDB{
2194
  *
2195
  * offset - The number by which to offset the terms query.
2196
  *
 
 
2197
  * fields - Default is 'all', which returns an array of term objects.
2198
  * If 'fields' is 'ids' or 'names', returns an array of
2199
  * integers or strings, respectively.
@@ -2207,12 +2219,6 @@ class GmediaDB{
2207
  * The 'get' argument, if set to 'all' instead of its default empty string,
2208
  * returns terms regardless of ancestry or whether the terms are empty.
2209
  *
2210
- * The 'child_of' argument, when used, should be set to the integer of a term ID. Its default
2211
- * is 0. If set to a non-zero value, all returned terms will be descendants
2212
- * of that term according to the given taxonomy. Hence 'child_of' is set to 0
2213
- * if more than one taxonomy is passed in $taxonomies, because multiple taxonomies
2214
- * make term ancestry ambiguous.
2215
- *
2216
  * The 'global' argument, when used, should be set to the integer of a term ID. Its default is
2217
  * the empty string '', which has a different meaning from the integer 0.
2218
  * If set to an integer value, all returned terms will have as an immediate
@@ -2259,6 +2265,7 @@ class GmediaDB{
2259
  'offset' => '',
2260
  'search' => '',
2261
  'global' => '',
 
2262
  'page' => 1,
2263
  'no_found_rows' => false
2264
  );
@@ -2286,6 +2293,7 @@ class GmediaDB{
2286
  * @var $offset
2287
  * @var $search
2288
  * @var $global
 
2289
  * @var $page
2290
  * @var $no_found_rows
2291
  * */
@@ -2406,6 +2414,18 @@ class GmediaDB{
2406
  $where .= $wpdb->prepare(" AND (t.name LIKE %s)", '%' . $search . '%');
2407
  }
2408
 
 
 
 
 
 
 
 
 
 
 
 
 
2409
  switch($fields){
2410
  case 'ids':
2411
  case 'id=>global':
@@ -2565,7 +2585,7 @@ class GmediaDB{
2565
  */
2566
  function insert_term($term, $taxonomy, $args = array()){
2567
  /** @var $wpdb wpdb */
2568
- global $wpdb, $gmDB, $gmGallery;
2569
 
2570
  if(!isset($gmGallery->options['taxonomies'][$taxonomy])){
2571
  return new WP_Error('gm_invalid_taxonomy', __('Invalid taxonomy'));
@@ -2584,7 +2604,7 @@ class GmediaDB{
2584
  return new WP_Error('gm_empty_term_name', __('A name is required for this term'));
2585
  }
2586
 
2587
- $defaults = array('description' => '', 'global' => 0, 'status' => 'public');
2588
  $args = wp_parse_args($args, $defaults);
2589
  $args['name'] = $term;
2590
  $args['taxonomy'] = $taxonomy;
@@ -2597,7 +2617,11 @@ class GmediaDB{
2597
 
2598
  // expected_slashed ($name)
2599
  $name = stripslashes($name);
2600
- $description = stripslashes($description);
 
 
 
 
2601
 
2602
  if(($term_id = $this->term_exists($name, $taxonomy, $global))){
2603
  // Same name, same global.
@@ -2680,33 +2704,42 @@ class GmediaDB{
2680
  // Merge old and new args with new args overwriting old ones.
2681
  $args = array_merge($term, $args);
2682
 
2683
- $defaults = array('name' => '', 'description' => '', 'global' => 0, 'orderby' => 'ID', 'order' => 'DESC', 'status' => 'public', 'gmedia_ids' => array());
2684
  $args = wp_parse_args($args, $defaults);
2685
 
2686
  /** @var $name
2687
  * @var $description
2688
- * @var $global
2689
  * @var $orderby
2690
  * @var $order
2691
  * @var $status
 
2692
  * @var $gmedia_ids
2693
  */
2694
  extract($args, EXTR_SKIP);
2695
 
2696
  // expected_slashed ($name)
2697
  $name = stripslashes($name);
2698
- $description = stripslashes($description);
 
 
 
 
2699
 
2700
  if('' == trim($name)){
2701
  return new WP_Error('gm_empty_term_name', __('A name is required for term'));
2702
  }
 
 
 
 
 
2703
 
2704
  $term_id = $wpdb->get_var($wpdb->prepare("SELECT t.term_id FROM {$wpdb->prefix}gmedia_term AS t WHERE t.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id));
2705
  do_action("edit_gmedia_term", $term_id, $taxonomy);
2706
  $wpdb->update($wpdb->prefix . 'gmedia_term', compact('term_id', 'name', 'taxonomy', 'description', 'global', 'status'), array('term_id' => $term_id));
2707
  do_action('edited_gmedia_term', $term_id, $taxonomy);
2708
 
2709
- if(('gmedia_album' == $taxonomy) && (isset($status) || ('custom' == $orderby)) && !empty($gmedia_ids)){
2710
  $db_gmedia_ids = $this->get_gmedias(array('no_found_rows' => true, 'album__in' => $term_id, 'orderby' => $orderby, 'order' => 'ASC', 'fields' => 'ids'));
2711
  if(!empty($db_gmedia_ids)){
2712
  if(isset($status_global)){
@@ -2721,7 +2754,7 @@ class GmediaDB{
2721
  }
2722
  }
2723
  }
2724
- if('custom' == $orderby) {
2725
  $db_gmedia_ids = array_flip($db_gmedia_ids);
2726
  if ($gmedia_ids != $db_gmedia_ids) {
2727
  $final_gmedia_ids = array_intersect_key($gmedia_ids, $db_gmedia_ids) + $db_gmedia_ids;
@@ -2875,7 +2908,11 @@ class GmediaDB{
2875
  }
2876
  if(!$term_id = $this->term_exists($term, $taxonomy, $global)){
2877
  // Skip if a non-existent term ID is passed or if taxonomy is category or if user is not allowed to add new terms.
2878
- if($gmCore->is_digit($term) || ($append < 0) || ('gmedia_category' == $taxonomy && !array_key_exists($term, $gmGallery->options['taxonomies']['gmedia_category'])) || ('gmedia_category' != $taxonomy && !current_user_can($taxonomy . '_manage'))
 
 
 
 
2879
  ){
2880
  continue;
2881
  }
@@ -2888,7 +2925,14 @@ class GmediaDB{
2888
  if(is_wp_error($term_id)){
2889
  return $term_id;
2890
  }
2891
- }
 
 
 
 
 
 
 
2892
  $term_ids[] = $term_id;
2893
 
2894
  if($append < 0){
2087
  */
2088
  function get_term($term, $taxonomy, $output = OBJECT){
2089
  /** @var $wpdb wpdb */
2090
+ global $wpdb, $user_ID, $gmCore;
2091
  $null = null;
2092
 
2093
  if(empty($term)){
2106
  if(is_object($term)){
2107
  $term = $term->term_id;
2108
  }
2109
+ if(!$gmCore->is_digit($term)){
2110
+ if($user_ID) {
2111
+ $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.* FROM {$wpdb->prefix}gmedia_term AS t WHERE t.taxonomy = %s AND t.name = %s AND t.global = %d LIMIT 1", $taxonomy, $term, $user_ID ) );
2112
+ if ( !$_term ) {
2113
+ return $null;
2114
+ }
2115
+ wp_cache_add( $_term->term_id, $_term, $taxonomy );
2116
+ } else {
2117
  return $null;
2118
  }
2119
+ } else {
2120
+ $term = (int) $term;
2121
+ if ( ! $_term = wp_cache_get( $term, $taxonomy ) ) {
2122
+ $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.* FROM {$wpdb->prefix}gmedia_term AS t WHERE t.taxonomy = %s AND t.term_id = %d LIMIT 1", $taxonomy, $term ) );
2123
+ if ( ! $_term ) {
2124
+ return $null;
2125
+ }
2126
+ wp_cache_add( $term, $_term, $taxonomy );
2127
+ }
2128
  }
2129
 
2130
  $_term = apply_filters('get_gmedia_term', $_term, $taxonomy);
2204
  *
2205
  * offset - The number by which to offset the terms query.
2206
  *
2207
+ * status - can be used generaly for albums. Defaults: 'public', 'private', 'draft'.
2208
+ *
2209
  * fields - Default is 'all', which returns an array of term objects.
2210
  * If 'fields' is 'ids' or 'names', returns an array of
2211
  * integers or strings, respectively.
2219
  * The 'get' argument, if set to 'all' instead of its default empty string,
2220
  * returns terms regardless of ancestry or whether the terms are empty.
2221
  *
 
 
 
 
 
 
2222
  * The 'global' argument, when used, should be set to the integer of a term ID. Its default is
2223
  * the empty string '', which has a different meaning from the integer 0.
2224
  * If set to an integer value, all returned terms will have as an immediate
2265
  'offset' => '',
2266
  'search' => '',
2267
  'global' => '',
2268
+ 'status' => '',
2269
  'page' => 1,
2270
  'no_found_rows' => false
2271
  );
2293
  * @var $offset
2294
  * @var $search
2295
  * @var $global
2296
+ * @var $status
2297
  * @var $page
2298
  * @var $no_found_rows
2299
  * */
2414
  $where .= $wpdb->prepare(" AND (t.name LIKE %s)", '%' . $search . '%');
2415
  }
2416
 
2417
+ if(!empty($status)){
2418
+ if(is_array($status)){
2419
+ $arr_status = array();
2420
+ foreach($status as $_status){
2421
+ $arr_status[] = $wpdb->prepare("t.status = %s", $_status);
2422
+ }
2423
+ $where .= ' AND (' . implode(' OR ', $arr_status) . ')';
2424
+ } else {
2425
+ $where .= $wpdb->prepare(" AND t.status = %s", $status);
2426
+ }
2427
+ }
2428
+
2429
  switch($fields){
2430
  case 'ids':
2431
  case 'id=>global':
2585
  */
2586
  function insert_term($term, $taxonomy, $args = array()){
2587
  /** @var $wpdb wpdb */
2588
+ global $wpdb, $gmDB, $gmGallery, $user_ID;
2589
 
2590
  if(!isset($gmGallery->options['taxonomies'][$taxonomy])){
2591
  return new WP_Error('gm_invalid_taxonomy', __('Invalid taxonomy'));
2604
  return new WP_Error('gm_empty_term_name', __('A name is required for this term'));
2605
  }
2606
 
2607
+ $defaults = array('description' => '', 'global' => intval($user_ID), 'status' => 'public');
2608
  $args = wp_parse_args($args, $defaults);
2609
  $args['name'] = $term;
2610
  $args['taxonomy'] = $taxonomy;
2617
 
2618
  // expected_slashed ($name)
2619
  $name = stripslashes($name);
2620
+ if('gmedia_module' == $taxonomy){
2621
+ $description = maybe_serialize( $description );
2622
+ } else {
2623
+ $description = stripslashes( $description );
2624
+ }
2625
 
2626
  if(($term_id = $this->term_exists($name, $taxonomy, $global))){
2627
  // Same name, same global.
2704
  // Merge old and new args with new args overwriting old ones.
2705
  $args = array_merge($term, $args);
2706
 
2707
+ $defaults = array('global' => $term['global'], 'name' => $term['name'], 'description' => '', 'status' => 'public', 'orderby' => 'ID', 'order' => 'DESC', 'gmedia_ids' => array());
2708
  $args = wp_parse_args($args, $defaults);
2709
 
2710
  /** @var $name
2711
  * @var $description
 
2712
  * @var $orderby
2713
  * @var $order
2714
  * @var $status
2715
+ * @var $global
2716
  * @var $gmedia_ids
2717
  */
2718
  extract($args, EXTR_SKIP);
2719
 
2720
  // expected_slashed ($name)
2721
  $name = stripslashes($name);
2722
+ if('gmedia_module' == $taxonomy){
2723
+ $description = maybe_serialize( $description );
2724
+ } else {
2725
+ $description = stripslashes( $description );
2726
+ }
2727
 
2728
  if('' == trim($name)){
2729
  return new WP_Error('gm_empty_term_name', __('A name is required for term'));
2730
  }
2731
+ if(current_user_can('gmedia_edit_others_media')){
2732
+ $global = (int) $global;
2733
+ } else{
2734
+ $global = $term['global'];
2735
+ }
2736
 
2737
  $term_id = $wpdb->get_var($wpdb->prepare("SELECT t.term_id FROM {$wpdb->prefix}gmedia_term AS t WHERE t.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id));
2738
  do_action("edit_gmedia_term", $term_id, $taxonomy);
2739
  $wpdb->update($wpdb->prefix . 'gmedia_term', compact('term_id', 'name', 'taxonomy', 'description', 'global', 'status'), array('term_id' => $term_id));
2740
  do_action('edited_gmedia_term', $term_id, $taxonomy);
2741
 
2742
+ if(('gmedia_album' == $taxonomy) && (isset($status) || ('custom' == $orderby))){
2743
  $db_gmedia_ids = $this->get_gmedias(array('no_found_rows' => true, 'album__in' => $term_id, 'orderby' => $orderby, 'order' => 'ASC', 'fields' => 'ids'));
2744
  if(!empty($db_gmedia_ids)){
2745
  if(isset($status_global)){
2754
  }
2755
  }
2756
  }
2757
+ if(('custom' == $orderby) && !empty($gmedia_ids)) {
2758
  $db_gmedia_ids = array_flip($db_gmedia_ids);
2759
  if ($gmedia_ids != $db_gmedia_ids) {
2760
  $final_gmedia_ids = array_intersect_key($gmedia_ids, $db_gmedia_ids) + $db_gmedia_ids;
2908
  }
2909
  if(!$term_id = $this->term_exists($term, $taxonomy, $global)){
2910
  // Skip if a non-existent term ID is passed or if taxonomy is category or if user is not allowed to add new terms.
2911
+ if(
2912
+ $gmCore->is_digit($term) ||
2913
+ ($append < 0) ||
2914
+ ('gmedia_category' == $taxonomy && !array_key_exists($term, $gmGallery->options['taxonomies']['gmedia_category'])) ||
2915
+ ('gmedia_category' != $taxonomy && !current_user_can($taxonomy . '_manage'))
2916
  ){
2917
  continue;
2918
  }
2925
  if(is_wp_error($term_id)){
2926
  return $term_id;
2927
  }
2928
+ } else{
2929
+ if(('gmedia_album' == $taxonomy) && !current_user_can('gmedia_edit_others_media')){
2930
+ $alb = $this->get_term($term_id, 'gmedia_album');
2931
+ if($alb->global && ($alb->global != get_current_user_id())){
2932
+ continue;
2933
+ }
2934
+ }
2935
+ }
2936
  $term_ids[] = $term_id;
2937
 
2938
  if($append < 0){
inc/image-editor.php CHANGED
@@ -20,7 +20,7 @@ function gmedia_image_editor(){
20
  <?php } ?>
21
  <div class="btn-group pull-left">
22
  <button type="button" id="gmedit-reset" name="gmedit_reset" class="btn btn-default" data-confirm="<?php _e('Do you really want reset all changes?') ?>"><?php _e('Reset', 'gmLang'); ?></button>
23
- <button type="button" id="gmedit-save" name="gmedit_save" data-loading-text="<?php _e('Working', 'gmLang'); ?>" class="btn btn-primary"><?php _e('Save image', 'gmLang'); ?></button>
24
  </div>
25
  <?php wp_nonce_field('gmedit-save'); ?>
26
  </div>
@@ -177,7 +177,8 @@ function gmedia_image_editor(){
177
  $('.gmedit-tool-button').tooltip({placement: 'bottom'});
178
 
179
  var gmeditSave = function(a, b){
180
- $('#gmedit-save').button('loading').prop('disabled', true);
 
181
  var post_data = {
182
  action: 'gmedit_save', id: gmid, image: a, applyto: $('#applyto').val(), _wpnonce: $('#_wpnonce').val()
183
  };
@@ -190,7 +191,7 @@ function gmedia_image_editor(){
190
  $('#gmedia-panel', parent_doc).before(c.msg);
191
  window.parent.closeModal('gmeditModal');
192
  } else{
193
- $('#gmedit-save').button('reset').prop('disabled', false);
194
  if(c.error){
195
  $('#media-edit-form-container .alert-box').html(c.error).show();
196
  } else{
@@ -207,7 +208,8 @@ function gmedia_image_editor(){
207
 
208
  jQuery("#gmedit").on("click", "#gmedit-restore", function(){
209
  $('#applyto').val('original');
210
- $('#gmedit-save').button('loading').prop('disabled', true);
 
211
  var post_data = {
212
  action: 'gmedit_restore', id: gmid, _wpnonce: $('#_wpnonce').val()
213
  };
@@ -229,7 +231,7 @@ function gmedia_image_editor(){
229
  $('#media-edit-form-container .alert-box').text(c).show();
230
  }
231
  }
232
- $('#gmedit-save').button('reset').prop('disabled', false);
233
  });
234
  });
235
 
20
  <?php } ?>
21
  <div class="btn-group pull-left">
22
  <button type="button" id="gmedit-reset" name="gmedit_reset" class="btn btn-default" data-confirm="<?php _e('Do you really want reset all changes?') ?>"><?php _e('Reset', 'gmLang'); ?></button>
23
+ <button type="button" id="gmedit-save" name="gmedit_save" data-loading-text="<?php _e('Working', 'gmLang'); ?>" data-reset-text="<?php _e('Save image', 'gmLang'); ?>" class="btn btn-primary"><?php _e('Save image', 'gmLang'); ?></button>
24
  </div>
25
  <?php wp_nonce_field('gmedit-save'); ?>
26
  </div>
177
  $('.gmedit-tool-button').tooltip({placement: 'bottom'});
178
 
179
  var gmeditSave = function(a, b){
180
+ var btn = $('#gmedit-save');
181
+ btn.text(btn.data('loading-text')).prop('disabled', true);
182
  var post_data = {
183
  action: 'gmedit_save', id: gmid, image: a, applyto: $('#applyto').val(), _wpnonce: $('#_wpnonce').val()
184
  };
191
  $('#gmedia-panel', parent_doc).before(c.msg);
192
  window.parent.closeModal('gmeditModal');
193
  } else{
194
+ btn.text(btn.data('reset-text')).prop('disabled', false);
195
  if(c.error){
196
  $('#media-edit-form-container .alert-box').html(c.error).show();
197
  } else{
208
 
209
  jQuery("#gmedit").on("click", "#gmedit-restore", function(){
210
  $('#applyto').val('original');
211
+ var btn = $('#gmedit-save');
212
+ btn.text(btn.data('loading-text')).prop('disabled', true);
213
  var post_data = {
214
  action: 'gmedit_restore', id: gmid, _wpnonce: $('#_wpnonce').val()
215
  };
231
  $('#media-edit-form-container .alert-box').text(c).show();
232
  }
233
  }
234
+ btn.text(btn.data('reset-text')).prop('disabled', false);
235
  });
236
  });
237
 
inc/media-upload.php CHANGED
@@ -1,100 +1,829 @@
1
  <?php
2
- if(preg_match('#' . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
3
- die('You are not allowed to call this page directly.');
4
  }
5
 
6
  /**
7
  * @title Add action/filter for the upload tab
8
  */
9
 
10
- if(current_user_can('gmedia_library')){
11
- add_filter('media_upload_tabs', 'gmedia_upload_tabs');
12
- add_action('media_upload_gmedia', 'media_upload_gmedia');
 
 
 
13
  }
14
 
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  /**
17
  * @param $tabs
18
  *
19
  * @return array
20
  */
21
- function gmedia_upload_tabs($tabs){
 
 
 
 
 
 
22
 
23
- $newtab = array('gmedia' => __('Gmedia Gallery', 'gmLang'));
 
 
24
 
25
- return array_merge($tabs, $newtab);
26
  }
27
 
28
- function media_upload_gmedia(){
29
  global $gmCore, $gmDB;
30
 
31
- wp_iframe('media_upload_gmedia_form');
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  // Generate TinyMCE HTML output
34
- if(isset($_POST['media-upload-insert-gmedia'])){
35
 
36
- $id = $gmCore->_post('ID', 0);
37
 
38
- if(($gmedia = $gmDB->get_gmedia($id))){
39
 
40
- $meta = $gmDB->get_metadata('gmedia', $gmedia->ID, '_metadata', true);
41
 
42
- $size = $gmCore->_post('size', 'web');
43
- $src = $gmCore->gm_get_media_image($gmedia, $size);
44
- $width = $meta[$size]['width'];
45
- $height = $meta[$size]['height'];
46
- $title = esc_attr($gmCore->_post('title', ''));
47
- $align = esc_attr($gmCore->_post('align', 'none'));
48
- $link = trim(esc_attr($gmCore->_post('link', '')));
49
- $caption = trim($gmCore->_post('description', ''));
50
 
51
  $html = "<img src='{$src}' width='{$width}' height='{$height}' alt='{$title}' title='{$title}' id='gmedia-image-{$id}' class='gmedia-singlepic align{$align}' />";
52
 
53
- if($link){
54
  $html = "<a href='{$link}'>{$html}</a>";
55
  }
56
- if($caption){
57
- $html = image_add_caption($html, false, $caption, $title, $align, $src, $size, $title);
58
  }
59
 
 
 
 
 
 
 
 
 
60
  // Return it to TinyMCE
61
- media_send_to_editor($html);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
- function media_upload_gmedia_form(){
68
 
69
- global $type, $user_ID;
70
- global $gmCore, $gmDB, $gmGallery;
71
 
72
- wp_enqueue_style('gmedia-bootstrap');
73
- wp_enqueue_script('gmedia-bootstrap');
74
 
75
- wp_enqueue_style('grand-media');
76
- wp_enqueue_script('grand-media');
77
 
78
- //media_upload_header();
 
79
 
80
- $post_id = intval($gmCore->_get('post_id'));
81
- //$url = admin_url("media-upload.php?type={$type}&tab=gmedia&post_id={$post_id}");
82
 
83
- if(current_user_can('gmedia_show_others_media')){
84
  $author = 0;
85
- } else{
86
  $author = $user_ID;
87
  }
88
- $args = array(
89
- 'mime_type' => $gmCore->_get('mime_type', 'image/*'),
90
- 'author' => $author,
91
- 'orderby' => 'ID',
92
- 'order' => 'DESC',
93
- 'per_page' => 30,
94
- 'page' => $gmCore->_get('pager', 1),
95
- 's' => $gmCore->_get('s', null)
96
  );
97
- $gmediaQuery = $gmDB->get_gmedias($args);
98
 
99
 
100
  ?>
@@ -103,14 +832,14 @@ function media_upload_gmedia_form(){
103
  <div class="panel-heading clearfix">
104
  <form class="form-inline gmedia-search-form" role="search">
105
  <div class="form-group">
106
- <?php foreach($_GET as $key => $value){
107
- if(in_array($key, array('type', 'post_id', 'tab', 'mime_type', 'tag_id', 'tag__in', 'cat', 'category__in', 'alb', 'album__in'))){
108
  ?>
109
  <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>"/>
110
  <?php
111
  }
112
  } ?>
113
- <input id="gmedia-search" class="form-control input-sm" type="text" name="s" placeholder="<?php _e('Search...', 'gmLang'); ?>" value="<?php echo $gmCore->_get('s', ''); ?>"/>
114
  </div>
115
  <button type="submit" class="btn btn-default input-sm"><span class="glyphicon glyphicon-search"></span></button>
116
  </form>
@@ -121,10 +850,10 @@ function media_upload_gmedia_form(){
121
  <div class="row">
122
  <div class="col-xs-7 col-md-9" style="text-align:justify;">
123
  <?php
124
- if(count($gmediaQuery)){
125
- foreach($gmediaQuery as $item){
126
- $meta = $gmDB->get_metadata('gmedia', $item->ID);
127
- $type = explode('/', $item->mime_type);
128
 
129
  /*
130
  $item_url = $gmCore->upload['url'] . '/' . $gmGallery->options['folder'][$type[0]] . '/' . $item->gmuid;
@@ -144,36 +873,36 @@ function media_upload_gmedia_form(){
144
  */
145
  ?>
146
  <form class="thumbnail" id="list-item-<?php echo $item->ID; ?>" data-id="<?php echo $item->ID; ?>" data-type="<?php echo $type[0]; ?>">
147
- <img src="<?php echo $gmCore->gm_get_media_image($item, 'thumb'); ?>" style="height:100px;width:auto;" alt=""/>
148
  <span class="glyphicon glyphicon-ok text-success"></span>
149
 
150
  <div class="media-upload-form" style="display:none;">
151
  <input name="ID" type="hidden" value="<?php echo $item->ID; ?>"/>
152
 
153
  <div class="form-group">
154
- <label><?php _e('Title', 'gmLang'); ?></label>
155
- <input name="title" type="text" class="form-control input-sm" placeholder="<?php _e('Title', 'gmLang'); ?>" value="<?php echo esc_attr($item->title); ?>">
156
  </div>
157
  <div class="form-group">
158
- <label><?php _e('Link To', 'gmLang'); ?></label>
159
  <select id="gmedia_url" class="form-control input-sm" style="display:block;margin-bottom:5px;">
160
- <option value="customurl" selected="selected"><?php _e('Custom URL'); ?></option>
161
- <option value="weburl"><?php _e('Web size image'); ?></option>
162
- <option value="originalurl"><?php _e('Original image'); ?></option>
163
  </select>
164
  <input name="link" type="text" class="customurl form-control input-sm" value="<?php echo $item->link; ?>" placeholder="http://"/>
165
  <input name="link" type="text" style="display:none;font-size:80%;" readonly="readonly" disabled="disabled" class="weburl form-control input-sm" value="<?php echo $gmCore->upload['url'] . '/' . $gmGallery->options['folder']['image'] . '/' . $item->gmuid; ?>"/>
166
  <input name="link" type="text" style="display:none;font-size:80%;" readonly="readonly" disabled="disabled" class="originalurl form-control input-sm" value="<?php echo $gmCore->upload['url'] . '/' . $gmGallery->options['folder']['image_original'] . '/' . $item->gmuid; ?>"/>
167
  </div>
168
  <div class="form-group">
169
- <label><?php _e('Description', 'gmLang'); ?></label>
170
- <textarea name="description" class="form-control input-sm" rows="4" cols="10"><?php echo esc_html($item->description); ?></textarea>
171
  </div>
172
  <?php //if($is_webimage){ ?>
173
- <?php if('image' == $type[0]){
174
- $_metadata = unserialize($meta['_metadata'][0]); ?>
175
  <div class="form-group">
176
- <label><?php _e('Size', 'gmLang'); ?></label>
177
  <select name="size" class="form-control input-sm">
178
  <option value="thumb"><?php echo 'Thumb - ' . $_metadata['thumb']['width'] . ' × ' . $_metadata['thumb']['height']; ?></option>
179
  <option value="web" selected="selected"><?php echo 'Web - ' . $_metadata['web']['width'] . ' × ' . $_metadata['web']['height']; ?></option>
@@ -183,26 +912,26 @@ function media_upload_gmedia_form(){
183
  <?php } ?>
184
  <?php //} ?>
185
  <div class="form-group">
186
- <label><?php _e('Alignment', 'gmLang'); ?></label>
187
  <select name="align" class="form-control input-sm">
188
- <option value="none" selected="selected"><?php _e('None', 'gmLang'); ?></option>
189
- <option value="left"><?php _e('Left', 'gmLang'); ?></option>
190
- <option value="center"><?php _e('Center', 'gmLang'); ?></option>
191
- <option value="right"><?php _e('Right', 'gmLang'); ?></option>
192
  </select>
193
  </div>
194
  </div>
195
  </form>
196
  <?php
197
  }
198
- } else{
199
  ?>
200
  <div class="list-group-item">
201
  <div class="well well-lg text-center">
202
- <h4><?php _e('No items to show.', 'gmLang'); ?></h4>
203
- <?php if($gmCore->caps['gmedia_upload']){ ?>
204
  <p>
205
- <a href="<?php echo admin_url('admin.php?page=GrandMedia_AddMedia') ?>" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> <?php _e('Add Media', 'gmLang'); ?>
206
  </a></p>
207
  <?php } ?>
208
  </div>
@@ -211,43 +940,336 @@ function media_upload_gmedia_form(){
211
  </div>
212
  <div class="col-xs-5 col-md-3 media-upload-sidebar">
213
  <form method="post" id="gmedia-form" role="form">
214
- <div id="media-upload-form-container"></div>
215
  <div class="panel-footer">
216
  <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>"/>
217
- <?php wp_nonce_field('media-form'); ?>
218
- <button type="submit" id="media-upload-form-submit" disabled class="btn btn-primary pull-right" name="media-upload-insert-gmedia"><?php _e('Insert into post', 'gmLang'); ?></button>
 
 
 
219
  </div>
220
  </form>
221
  </div>
222
  </div>
223
  </div>
224
  <script type="text/javascript">
225
- jQuery(function($){
226
- function divFrame(){
227
  $('.panel-body').css({top: $('.panel-heading').outerHeight()});
228
  }
229
 
230
  divFrame();
231
- $(window).on('resize', function(){
232
  divFrame();
233
  });
234
- $('.thumbnail').on('click', function(){
235
- if($(this).hasClass('active')){
 
 
236
  $(this).removeClass('active');
237
- $('#media-upload-form-container').empty();
238
- $('#media-upload-form-submit').prop('disabled', true);
239
  return;
240
  }
241
  $(this).addClass('active').siblings().removeClass('active');
242
- $('#media-upload-form-container').html($('.media-upload-form', this).html());
243
- $('#media-upload-form-submit').prop('disabled', false);
244
  });
245
- $('#gmedia-form').on('change', '#gmedia_url', function(){
246
  var val = $(this).val();
247
  $(this).nextAll('input.' + val).show().prop('disabled', false).siblings('input').hide().prop('disabled', true);
248
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  });
250
  </script>
251
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  <?php
253
  }
 
1
  <?php
2
+ if ( preg_match( '#' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
  /**
7
  * @title Add action/filter for the upload tab
8
  */
9
 
10
+ if ( current_user_can( 'gmedia_library' ) ) {
11
+ add_filter( 'media_buttons_context', 'gmedia_media_buttons_context', 4 );
12
+ add_filter( 'media_upload_tabs', 'gmedia_upload_tabs' );
13
+ add_action( 'media_upload_gmedia_library', 'media_upload_gmedia' );
14
+ add_action( 'media_upload_gmedia_terms', 'media_upload_gmedia' );
15
+ add_action( 'media_upload_gmedia_galleries', 'media_upload_gmedia' );
16
  }
17
 
18
 
19
+ /**
20
+ * @param $context
21
+ *
22
+ * @return string
23
+ */
24
+ function gmedia_media_buttons_context( $context ) {
25
+ global $post;
26
+ $button = '
27
+ <div style="display:inline-block;">
28
+ <a id="gmedia-modal" title="Gmedia Galleries" class="gmedia_button button" href="#gmedia"><span class="wp-media-buttons-icon" style="background: url(' . plugins_url( GMEDIA_FOLDER . '/admin/images/gm-icon.png' ) . ') no-repeat top left;"></span> ' . __( 'Gmedia', 'gmLang' ) . '</a>
29
+ <script type="text/html" id="tpl__gm-uploader">
30
+ <div id="__gm-uploader" tabindex="0">
31
+ <div class="media-modal wp-core-ui"><a class="media-modal-close" href="#"><span class="media-modal-icon"></span></a>
32
+ <div class="media-modal-content"><div class="media-frame wp-core-ui hide-router hide-toolbar">
33
+ <div class="media-frame-title"><h1>' . __( 'Gmedia Galleries', 'gmLang' ) . '</h1></div>
34
+ <div class="media-frame-menu"><div class="media-menu">
35
+ <a id="gmedia-modal-galleries" class="media-menu-item active" target="gmedia_frame" href="' . add_query_arg( array( 'post_id' => $post->ID, 'tab' => 'gmedia_galleries', 'chromeless' => true ), admin_url( 'media-upload.php' ) ) . '">' . __( 'Gmedia Galleries', 'gmLang' ) . '</a>
36
+ <a id="gmedia-modal-terms" class="media-menu-item" target="gmedia_frame" href="' . add_query_arg( array( 'post_id' => $post->ID, 'tab' => 'gmedia_terms', 'chromeless' => true ), admin_url( 'media-upload.php' ) ) . '">' . __( 'Gmedia Collections', 'gmLang' ) . '</a>
37
+ <a id="gmedia-modal-library" class="media-menu-item" target="gmedia_frame" href="' . add_query_arg( array( 'post_id' => $post->ID, 'tab' => 'gmedia_library', 'chromeless' => true ), admin_url( 'media-upload.php' ) ) . '">' . __( 'Gmedia Library', 'gmLang' ) . '</a>';
38
+ if ( current_user_can( 'gmedia_upload' ) ) {
39
+ $button .= '
40
+ <a id="gmedia-modal-upload" class="media-menu-item" target="gmedia_frame" href="' . add_query_arg( array( 'post_id' => $post->ID, 'tab' => 'gmedia_library', 'action' => 'upload', 'chromeless' => true ), admin_url( 'media-upload.php' ) ) . '">' . __( 'Gmedia Upload', 'gmLang' ) . '</a>';
41
+ }
42
+ $button .= '
43
+ </div></div>
44
+ <div class="media-frame-content"><div class="media-iframe"><iframe name="gmedia_frame" src="' . add_query_arg( array( 'post_id' => $post->ID, 'tab' => 'gmedia_galleries', 'chromeless' => true ), admin_url( 'media-upload.php' ) ) . '"></iframe></div></div>
45
+ </div></div>
46
+ </div><div class="media-modal-backdrop"></div>
47
+ </div>
48
+ </script>
49
+ </div>';
50
+
51
+ return $context . $button;
52
+ }
53
+
54
  /**
55
  * @param $tabs
56
  *
57
  * @return array
58
  */
59
+ function gmedia_upload_tabs( $tabs ) {
60
+
61
+ $newtab = array(
62
+ 'gmedia_library' => __( 'Gmedia Library', 'gmLang' ),
63
+ 'gmedia_terms' => __( 'Gmedia Collections', 'gmLang' ),
64
+ 'gmedia_galleries' => __( 'Gmedia Galleries', 'gmLang' )
65
+ );
66
 
67
+ if ( is_array( $tabs ) ) {
68
+ return array_merge( $tabs, $newtab );
69
+ }
70
 
71
+ return $newtab;
72
  }
73
 
74
+ function media_upload_gmedia() {
75
  global $gmCore, $gmDB;
76
 
77
+ add_action( 'admin_enqueue_scripts', 'gmedia_add_media_popup_enqueue_scripts' );
78
+
79
+ $action = $gmCore->_get( 'action' );
80
+ if ( did_action( 'media_upload_gmedia_galleries' ) ) {
81
+ wp_iframe( 'gmedia_add_media_galleries' );
82
+ } elseif ( did_action( 'media_upload_gmedia_terms' ) ) {
83
+ wp_iframe( 'gmedia_add_media_terms' );
84
+ } elseif ( did_action( 'media_upload_gmedia_library' ) ) {
85
+ if ( ( 'upload' == $action ) && current_user_can( 'gmedia_upload' ) ) {
86
+ wp_iframe( 'gmedia_add_media_upload' );
87
+ } else {
88
+ wp_iframe( 'gmedia_add_media_library' );
89
+ }
90
+ }
91
 
92
  // Generate TinyMCE HTML output
93
+ if ( isset( $_POST['gmedia_library_insert'] ) ) {
94
 
95
+ $id = $gmCore->_post( 'ID', 0 );
96
 
97
+ if ( ( $gmedia = $gmDB->get_gmedia( $id ) ) ) {
98
 
99
+ $meta = $gmDB->get_metadata( 'gmedia', $gmedia->ID, '_metadata', true );
100
 
101
+ $size = $gmCore->_post( 'size', 'web' );
102
+ $src = $gmCore->gm_get_media_image( $gmedia, $size );
103
+ $width = $meta[ $size ]['width'];
104
+ $height = $meta[ $size ]['height'];
105
+ $title = esc_attr( $gmCore->_post( 'title', '' ) );
106
+ $align = esc_attr( $gmCore->_post( 'align', 'none' ) );
107
+ $link = trim( esc_attr( $gmCore->_post( 'link', '' ) ) );
108
+ $caption = trim( $gmCore->_post( 'description', '' ) );
109
 
110
  $html = "<img src='{$src}' width='{$width}' height='{$height}' alt='{$title}' title='{$title}' id='gmedia-image-{$id}' class='gmedia-singlepic align{$align}' />";
111
 
112
+ if ( $link ) {
113
  $html = "<a href='{$link}'>{$html}</a>";
114
  }
115
+ if ( $caption ) {
116
+ $html = image_add_caption( $html, false, $caption, $title, $align, $src, $size, $title );
117
  }
118
 
119
+ ?>
120
+ <script type="text/javascript">
121
+ /* <![CDATA[ */
122
+ var win = window.dialogArguments || opener || parent || top;
123
+ jQuery('#__gm-uploader', win.document).css('display', 'none');
124
+ /* ]]> */
125
+ </script>
126
+ <?php
127
  // Return it to TinyMCE
128
+ media_send_to_editor( $html );
129
+ }
130
+ }
131
+ if ( isset( $_POST['gmedia_gallery_insert'] ) ) {
132
+ $sc = $gmCore->_post( 'shortcode' );
133
+ ?>
134
+ <script type="text/javascript">
135
+ /* <![CDATA[ */
136
+ var win = window.dialogArguments || opener || parent || top;
137
+ jQuery('#__gm-uploader', win.document).css('display', 'none');
138
+ /* ]]> */
139
+ </script>
140
+ <?php
141
+ // Return it to TinyMCE
142
+ media_send_to_editor( $sc );
143
+ }
144
+ if ( isset( $_POST['gmedia_term_insert'] ) ) {
145
+ $module_preset = $gmCore->_post('module_preset');
146
+ if($gmCore->is_digit($module_preset)){
147
+ $module_preset = $gmDB->get_term( (int) $module_preset, 'gmedia_module');
148
+ $module = $module_preset->status;
149
+ $preset = ' preset=' . $module_preset->term_id;
150
+ } else {
151
+ $module = $module_preset;
152
+ $preset = '';
153
+ }
154
+ $tax = $gmCore->_post('taxonomy');
155
+ $term_id = $gmCore->_post('term_id');
156
+ if($tax && $term_id && $module){
157
+ $tax = str_replace('gmedia_', '', $tax);
158
+ $sc = "[gm {$tax}={$term_id} module={$module}{$preset}]";
159
+ ?>
160
+ <script type="text/javascript">
161
+ /* <![CDATA[ */
162
+ var win = window.dialogArguments || opener || parent || top;
163
+ jQuery('#__gm-uploader', win.document).css('display', 'none');
164
+ /* ]]> */
165
+ </script>
166
+ <?php
167
+ // Return it to TinyMCE
168
+ media_send_to_editor( $sc );
169
+ }
170
+ }
171
+
172
+ }
173
+
174
+ function gmedia_add_media_popup_enqueue_scripts() {
175
+ global $gmCore;
176
+
177
+ wp_dequeue_script( 'imgareaselect' );
178
+ wp_dequeue_script( 'image-edit' );
179
+ wp_dequeue_script( 'set-post-thumbnail' );
180
+ wp_dequeue_script( 'media-gallery' );
181
+ wp_dequeue_script( 'plupload' );
182
+ wp_dequeue_script( 'plupload-handlers' );
183
+ wp_dequeue_style( 'imgareaselect' );
184
+
185
+ wp_enqueue_style( 'gmedia-bootstrap' );
186
+ wp_enqueue_script( 'gmedia-bootstrap' );
187
+
188
+ wp_enqueue_style( 'grand-media' );
189
+ wp_enqueue_script( 'grand-media' );
190
+
191
+ $action = $gmCore->_get( 'action' );
192
+ if ( did_action( 'media_upload_gmedia_library' ) && ( 'upload' == $action ) && current_user_can( 'gmedia_upload' ) ) {
193
+ if ( current_user_can( 'gmedia_terms' ) ) {
194
+ wp_enqueue_style( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.bootstrap3.css', array( 'gmedia-bootstrap' ), '0.8.5', 'screen' );
195
+ wp_enqueue_script( 'selectize', $gmCore->gmedia_url . '/assets/selectize/selectize.min.js', array( 'jquery' ), '0.8.5' );
196
+ }
197
+ wp_enqueue_style( 'jquery-ui-smoothness', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css', array(), '1.10.2', 'screen' );
198
+ wp_enqueue_script( 'jquery-ui-full', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js', array(), '1.10.2' );
199
+
200
+ wp_enqueue_script( 'gmedia-plupload', $gmCore->gmedia_url . '/assets/plupload/plupload.full.min.js', array( 'jquery', 'jquery-ui-full' ), '2.1.2' );
201
+
202
+ wp_enqueue_style( 'jquery.ui.plupload', $gmCore->gmedia_url . '/assets/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css', array( 'jquery-ui-smoothness' ), '2.1.2', 'screen' );
203
+ wp_enqueue_script( 'jquery.ui.plupload', $gmCore->gmedia_url . '/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js', array( 'gmedia-plupload', 'jquery-ui-full' ), '2.1.2' );
204
+ }
205
+
206
+ }
207
+
208
+ function gmedia_add_media_galleries() {
209
+
210
+ global $user_ID, $gmCore, $gmDB, $gmGallery, $gmProcessor;
211
+
212
+ $post_id = intval( $gmCore->_get( 'post_id' ) );
213
+
214
+ $args = array(
215
+ 'orderby' => $gmCore->_get( 'orderby', 'name' ),
216
+ 'order' => $gmCore->_get( 'order', 'ASC' ),
217
+ 'search' => $gmCore->_get( 's', '' ),
218
+ 'number' => $gmCore->_get( 'number', 30 ),
219
+ 'hide_empty' => 0,
220
+ 'page' => $gmCore->_get( 'pager', 1 ),
221
+ 'status' => array( 'public', 'private' )
222
+ );
223
+ $args['offset'] = ( $args['page'] - 1 ) * $args['number'];
224
+
225
+
226
+ if ( current_user_can( 'gmedia_show_others_media' ) ) {
227
+ $args['global'] = $gmCore->_get( 'author', '' );
228
+ } else {
229
+ $args['global'] = array( $user_ID );
230
+ }
231
+
232
+ $taxonomy = 'gmedia_gallery';
233
+ $gmediaTerms = $gmDB->get_terms( $taxonomy, $args );
234
+ $alert = '';
235
+ if ( is_wp_error( $gmediaTerms ) ) {
236
+ $alert = $gmProcessor->alert( 'danger', $gmediaTerms->get_error_message() );
237
+ $gmediaTerms = array();
238
+ }
239
+
240
+ $modules = array();
241
+ if ( ( $plugin_modules = glob( GMEDIA_ABSPATH . 'module/*', GLOB_ONLYDIR | GLOB_NOSORT ) ) ) {
242
+ foreach ( $plugin_modules as $path ) {
243
+ $mfold = basename( $path );
244
+ $modules[ $mfold ] = array(
245
+ 'module_name' => $mfold,
246
+ 'module_url' => $gmCore->gmedia_url . "/module/{$mfold}",
247
+ 'module_path' => $path
248
+ );
249
+ }
250
+ }
251
+ if ( ( $upload_modules = glob( $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/*', GLOB_ONLYDIR | GLOB_NOSORT ) ) ) {
252
+ foreach ( $upload_modules as $path ) {
253
+ $mfold = basename( $path );
254
+ $modules[ $mfold ] = array(
255
+ 'module_name' => $mfold,
256
+ 'module_url' => $gmCore->upload['url'] . "/{$gmGallery->options['folder']['module']}/{$mfold}",
257
+ 'module_path' => $path
258
+ );
259
+ }
260
+ }
261
+
262
+ ?>
263
+
264
+ <div class="panel panel-default">
265
+ <div class="panel-heading clearfix">
266
+ <form class="form-inline gmedia-search-form" role="search" method="get">
267
+ <div class="form-group">
268
+ <?php foreach ( $_GET as $key => $value ) {
269
+ if ( in_array( $key, array( 'chromeless', 'post_id', 'tab', 'orderby', 'order', 'number', 'global' ) ) ) {
270
+ ?>
271
+ <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>"/>
272
+ <?php
273
+ }
274
+ } ?>
275
+ <input id="gmedia-search" class="form-control input-sm" type="text" name="s" placeholder="<?php _e( 'Search...', 'gmLang' ); ?>" value="<?php echo $gmCore->_get( 's', '' ); ?>"/>
276
+ </div>
277
+ <button type="submit" class="btn btn-default input-sm"><span class="glyphicon glyphicon-search"></span></button>
278
+ </form>
279
+ <?php echo $gmDB->query_pager(); ?>
280
+
281
+ <div class="btn-group" style="margin-right:20px;">
282
+ <a class="btn btn-primary" target="_blank" href="<?php echo add_query_arg( array( 'page' => 'GrandMedia_Modules' ), admin_url( 'admin.php' ) ); ?>"><?php _e( 'Create Gallery', 'gmLang' ); ?></a>
283
+ </div>
284
+
285
+ <div class="btn-group" style="margin-right:20px;">
286
+ <a class="btn btn-success" href="#" onclick="location.reload(true); return false;"><?php _e( 'Refresh', 'gmLang' ); ?></a>
287
+ </div>
288
+
289
+ </div>
290
+ <div class="panel-body" id="gmedia-msg-panel"><?php echo $alert; ?></div>
291
+ <div class="panel-body" id="gm-list-table">
292
+ <div class="row">
293
+ <div class="col-xs-7 col-md-9" style="padding: 0">
294
+ <div class="list-group">
295
+ <?php
296
+ if ( count( $gmediaTerms ) ) {
297
+ $lib_url = add_query_arg( array( 'page' => 'GrandMedia' ), admin_url( 'admin.php' ) );
298
+ foreach ( $gmediaTerms as $term ) {
299
+
300
+ $term_meta = $gmDB->get_metadata( 'gmedia_term', $term->term_id );
301
+ $term_meta = array_map( 'reset', $term_meta );
302
+ $term_meta = array_map( 'maybe_unserialize', $term_meta );
303
+
304
+ $module = $gmCore->get_module_path( $term_meta['module'] );
305
+ $module_info = array( 'type' => '&#8212;' );
306
+ if ( file_exists( $module['path'] . '/index.php' ) ) {
307
+ $broken = false;
308
+ include( $module['path'] . '/index.php' );
309
+ } else {
310
+ $broken = true;
311
+ }
312
+
313
+ $list_row_class = '';
314
+ if ( 'private' == $term->status ) {
315
+ $list_row_class = ' list-group-item-info';
316
+ }
317
+ ?>
318
+ <div class="gmedia-insert-item list-group-item clearfix d-row<?php echo $list_row_class; ?>" id="list-item-<?php echo $term->term_id; ?>" data-id="<?php echo $term->term_id; ?>" data-type="<?php echo $term_meta['module']; ?>">
319
+ <div class="media-object pull-left" style="width:130px;">
320
+ <?php if ( ! $broken ) { ?>
321
+ <span class="thumbnail"><img src="<?php echo $module['url'] . '/screenshot.png'; ?>" alt="<?php echo esc_attr( $term->name ); ?>"/></span>
322
+ <?php } else { ?>
323
+ <div class="bg-danger text-center"><?php _e( 'Module broken <br>Reinstall module', 'gmLang' ) ?></div>
324
+ <?php } ?>
325
+ </div>
326
+
327
+ <div class="media-body" style="margin-left:145px;">
328
+ <p class="media-title">
329
+ <span><?php echo esc_html( $term->name ); ?></span>
330
+ </p>
331
+
332
+ <p class="media-meta">
333
+ <span class="label label-default"><?php _e( 'Author', 'gmLang' ); ?>:</span> <?php echo $term->global ? get_the_author_meta( 'display_name', $term->global ) : '&#8212;'; ?>
334
+ </p>
335
+
336
+ <p class="media-caption"><?php echo esc_html( $term->description ); ?></p>
337
+ </div>
338
+
339
+ <p class="media-meta hidden" style="font-weight:bold">
340
+ <span class="label label-default"><?php _e( 'Shortcode', 'gmLang' ); ?>:</span> [gmedia id=<?php echo $term->term_id; ?>]
341
+ <input type="hidden" name="shortcode" value="[gmedia id=<?php echo $term->term_id; ?>]"/>
342
+ </p>
343
+
344
+ <p class="media-meta clear hidden">
345
+ <span class="label label-default"><?php _e( 'Module', 'gmLang' ); ?>:</span> <?php echo $term_meta['module']; ?>
346
+ <br><span class="label label-default"><?php _e( 'Type', 'gmLang' ); ?>:</span> <?php echo $module_info['type']; ?>
347
+ <br><span class="label label-default"><?php _e( 'Last Edited', 'gmLang' ); ?>:</span> <?php echo $term_meta['edited']; ?>
348
+ <br><span class="label label-default"><?php _e( 'Status', 'gmLang' ); ?>:</span> <?php echo $term->status; ?>
349
+ <br><span class="label label-default"><?php _e( 'Source', 'gmLang' ); ?>:</span>
350
+ <?php
351
+ $gallery_tabs = reset( $term_meta['query'] );
352
+ $tax_tabs = key( $term_meta['query'] );
353
+ if ( 'gmedia__in' == $tax_tabs ) {
354
+ _e( 'Selected Gmedia', 'gmLang' );
355
+ if ( ! ( ( (int) $term->global != $user_ID ) && ! current_user_can( 'gmedia_show_others_media' ) ) ) {
356
+ $gmedia_ids = wp_parse_id_list( $gallery_tabs[0] );
357
+ $gal_source = sprintf( '<a class="selected__in" target="_blank" href="%s">' . __( 'Show %d items in Gmedia Library', 'gmLang' ) . '</a>', esc_url( add_query_arg( array( 'gmedia__in' => implode( ',', $gmedia_ids ) ), $lib_url ) ), count( $gmedia_ids ) );
358
+ echo " ($gal_source)";
359
+ }
360
+ } else {
361
+ $tabs = $gmDB->get_terms( $tax_tabs, array( 'include' => $gallery_tabs ) );
362
+ $terms_source = array();
363
+ if ( 'gmedia_category' == $tax_tabs ) {
364
+ _e( 'Categories', 'gmLang' );
365
+ foreach ( $tabs as $t ) {
366
+ $terms_source[] = sprintf( '<a class="category" target="_blank" href="%s">%s</a>', esc_url( add_query_arg( array( 'cat' => $t->term_id ), $lib_url ) ), esc_html( $gmGallery->options['taxonomies']['gmedia_category'][ $t->name ] ) );
367
+ }
368
+ } elseif ( 'gmedia_album' == $tax_tabs ) {
369
+ _e( 'Albums', 'gmLang' );
370
+ foreach ( $tabs as $t ) {
371
+ $terms_source[] = sprintf( '<a class="album" target="_blank" href="%s">%s</a>', esc_url( add_query_arg( array( 'alb' => $t->term_id ), $lib_url ) ), esc_html( $t->name ) );
372
+ }
373
+ } elseif ( 'gmedia_tag' == $tax_tabs ) {
374
+ _e( 'Tags', 'gmLang' );
375
+ foreach ( $tabs as $t ) {
376
+ $terms_source[] = sprintf( '<a class="tag" target="_blank" href="%s">%s</a>', esc_url( add_query_arg( array( 'tag_id' => $t->term_id ), $lib_url ) ), esc_html( $t->name ) );
377
+ }
378
+ } elseif ( 'gmedia_filter' == $tax_tabs ) {
379
+ _e( 'Filters', 'gmLang' );
380
+ foreach ( $tabs as $t ) {
381
+ $terms_source[] = sprintf( '<a class="filter" target="_blank" href="%s">%s</a>', esc_url( add_query_arg( array( 'stack_id' => $t->term_id ), $lib_url ) ), esc_html( $t->name ) );
382
+ }
383
+ }
384
+ if ( ! empty( $terms_source ) ) {
385
+ $terms_source = join( ', ', $terms_source );
386
+ if ( ( (int) $term->global != $user_ID ) && ! current_user_can( 'gmedia_show_others_media' ) ) {
387
+ $terms_source = strip_tags( $terms_source );
388
+ }
389
+ echo " ({$terms_source})";
390
+ }
391
+ }
392
+ ?>
393
+ </p>
394
+ <?php if ( current_user_can( 'gmedia_gallery_manage' ) ) {
395
+ if ( ! ( ( (int) $term->global != $user_ID ) && ! current_user_can( 'gmedia_edit_others_media' ) ) ) {
396
+ ?>
397
+ <p class="media-meta hidden"><a target="_blank" href="<?php echo add_query_arg( array( 'page' => 'GrandMedia_Galleries', 'edit_gallery' => $term->term_id ), admin_url( 'admin.php' ) ); ?>"><?php _e( 'Edit gallery', 'gmLang' ); ?></a></p>
398
+ <?php
399
+ }
400
+ } ?>
401
+
402
+ </div>
403
+ <?php
404
+ }
405
+ } else {
406
+ ?>
407
+ <div class="list-group-item">
408
+ <div class="well well-lg text-center">
409
+ <h4><?php _e( 'No items to show.', 'gmLang' ); ?></h4>
410
+ </div>
411
+ </div>
412
+ <?php } ?>
413
+ </div>
414
+ </div>
415
+ <div class="col-xs-5 col-md-3 media-upload-sidebar">
416
+ <form method="post" id="gmedia-form" role="form">
417
+ <div id="media-upload-form-container" class="media-upload-form-container"></div>
418
+ <div class="panel-footer">
419
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>"/>
420
+ <?php wp_nonce_field( 'media-form' ); ?>
421
+ <button type="submit" id="media-upload-form-submit" disabled class="btn btn-primary pull-right" name="gmedia_gallery_insert"><?php _e( 'Insert into post', 'gmLang' ); ?></button>
422
+ </div>
423
+ </form>
424
+ </div>
425
+ </div>
426
+ </div>
427
+ <script type="text/javascript">
428
+ jQuery(function ($) {
429
+ function divFrame() {
430
+ $('.panel-body').css({top: $('.panel-heading').outerHeight()});
431
+ }
432
+
433
+ divFrame();
434
+ $(window).on('resize', function () {
435
+ divFrame();
436
+ });
437
+ $('.gmedia-insert-item').on('click', function () {
438
+ if ($(this).hasClass('active')) {
439
+ $(this).removeClass('active');
440
+ $('#media-upload-form-container').empty();
441
+ $('#media-upload-form-submit').prop('disabled', true);
442
+ return;
443
+ }
444
+ $(this).addClass('active').siblings().removeClass('active');
445
+ var info = $(this).clone();
446
+ info.find('.media-caption').remove().end().find('.hidden').removeClass('hidden');
447
+ $('#media-upload-form-container').html(info.html());
448
+ $('#media-upload-form-submit').prop('disabled', false);
449
+ });
450
+ });
451
+ </script>
452
+ </div>
453
+ <?php
454
+ }
455
+
456
+ function gmedia_add_media_terms() {
457
+
458
+ global $user_ID, $gmCore, $gmDB, $gmGallery, $gmProcessor;
459
+
460
+ $post_id = intval( $gmCore->_get( 'post_id' ) );
461
+
462
+ $url = add_query_arg( array( 'post_id' => $post_id, 'tab' => 'gmedia_terms', 'chromeless' => true ), admin_url( 'media-upload.php' ) );
463
+
464
+ /* todo: per_page options for gmedia_terms
465
+ $gm_screen_options = get_user_meta($user_ID, 'gm_screen_options', true);
466
+ if(!is_array($gm_screen_options)){
467
+ $gm_screen_options = array();
468
+ }
469
+ $gm_screen_options = array_merge($gmGallery->options['gm_screen_options'], $gm_screen_options);
470
+ */
471
+
472
+ $args = array(
473
+ 'orderby' => $gmCore->_get( 'orderby', 'name' ),
474
+ 'order' => $gmCore->_get( 'order', 'ASC' ),
475
+ 'search' => $gmCore->_get( 's', '' ),
476
+ 'number' => $gmCore->_get( 'number', 30 ),
477
+ 'hide_empty' => $gmCore->_get( 'hide_empty', 0 ),
478
+ 'page' => $gmCore->_get( 'pager', 1 )
479
+ );
480
+ $args['offset'] = ( $args['page'] - 1 ) * $args['number'];
481
+
482
+ $taxonomy = $gmCore->_get( 'term', 'gmedia_album' );
483
+ if ( !in_array($taxonomy, array('gmedia_album', 'gmedia_tag', 'gmedia_category')) ) {
484
+ $taxonomy = 'gmedia_album';
485
+ }
486
+
487
+ switch ( $taxonomy ) {
488
+ case 'gmedia_album':
489
+ $args['status'] = array( 'public', 'private' );
490
+ $args['global'] = $gmCore->_get( 'author', $gmCore->caps['gmedia_edit_others_media'] ? '' : array( 0, $user_ID ) );
491
+ if ( ! $gmCore->caps['gmedia_show_others_media'] ) {
492
+ $args['global'] = wp_parse_id_list( $args['global'] );
493
+ $args['global'] = array_intersect( array( 0, $user_ID ), $args['global'] );
494
+ if ( empty( $args['global'] ) ) {
495
+ $args['global'] = array( 0, $user_ID );
496
+ }
497
+ }
498
+ if ( ! $gmCore->caps['gmedia_edit_others_media'] ) {
499
+ $args['orderby'] = $gmCore->_get( 'orderby', 'global_desc_name' );
500
+ }
501
+ break;
502
+ case 'gmedia_category':
503
+ $args['number'] = '';
504
+ $args['offset'] = '';
505
+ $args['search'] = '';
506
+ $args['include'] = null;
507
+ break;
508
+ }
509
+
510
+ $gmediaTerms = $gmDB->get_terms( $taxonomy, $args );
511
+ $alert = '';
512
+ if ( is_wp_error( $gmediaTerms ) ) {
513
+ $alert = $gmProcessor->alert( 'danger', $gmediaTerms->get_error_message() );
514
+ $gmediaTerms = array();
515
+ }
516
+
517
+ $modules = array();
518
+ if ( ( $plugin_modules = glob( GMEDIA_ABSPATH . 'module/*', GLOB_ONLYDIR | GLOB_NOSORT ) ) ) {
519
+ foreach ( $plugin_modules as $path ) {
520
+ if ( ! file_exists( $path . '/index.php' ) ) {
521
+ continue;
522
+ }
523
+ $module_info = array();
524
+ include( $path . '/index.php' );
525
+ if ( empty( $module_info ) ) {
526
+ continue;
527
+ }
528
+ $mfold = basename( $path );
529
+ $modules[ $mfold ] = array(
530
+ 'module_name' => $mfold,
531
+ 'module_title' => $module_info['title'] . ' v' . $module_info['version'],
532
+ 'module_url' => $gmCore->gmedia_url . "/module/{$mfold}",
533
+ 'module_path' => $path
534
+ );
535
  }
536
  }
537
+ if ( ( $upload_modules = glob( $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['module'] . '/*', GLOB_ONLYDIR | GLOB_NOSORT ) ) ) {
538
+ foreach ( $upload_modules as $path ) {
539
+ if ( ! file_exists( $path . '/index.php' ) ) {
540
+ continue;
541
+ }
542
+ $module_info = array();
543
+ include( $path . '/index.php' );
544
+ if ( empty( $module_info ) ) {
545
+ continue;
546
+ }
547
+ $mfold = basename( $path );
548
+ $modules[ $mfold ] = array(
549
+ 'module_name' => $mfold,
550
+ 'module_title' => $module_info['title'] . ' v' . $module_info['version'],
551
+ 'module_url' => $gmCore->upload['url'] . "/{$gmGallery->options['folder']['module']}/{$mfold}",
552
+ 'module_path' => $path
553
+ );
554
+ }
555
+ }
556
+
557
+ ?>
558
+
559
+ <div class="panel panel-default">
560
+ <div class="panel-heading clearfix">
561
+ <?php if ('gmedia_category' != $taxonomy) { ?>
562
+ <form class="form-inline gmedia-search-form" role="search" method="get">
563
+ <div class="form-group">
564
+ <?php foreach ( $_GET as $key => $value ) {
565
+ if ( in_array( $key, array( 'chromeless', 'post_id', 'tab', 'orderby', 'order', 'number', 'global' ) ) ) {
566
+ ?>
567
+ <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>"/>
568
+ <?php
569
+ }
570
+ } ?>
571
+ <input id="gmedia-search" class="form-control input-sm" type="text" name="s" placeholder="<?php _e( 'Search...', 'gmLang' ); ?>" value="<?php echo $gmCore->_get( 's', '' ); ?>"/>
572
+ </div>
573
+ <button type="submit" class="btn btn-default input-sm"><span class="glyphicon glyphicon-search"></span></button>
574
+ </form>
575
+ <?php echo $gmDB->query_pager(); ?>
576
+ <?php } ?>
577
+
578
+ <div class="btn-group" style="margin-right:20px;">
579
+ <a class="btn btn<?php echo ( 'gmedia_album' == $taxonomy ) ? "-primary active" : '-default'; ?>"
580
+ href="<?php echo add_query_arg( array( 'term' => 'gmedia_album' ), $url ); ?>"><?php _e( 'Albums', 'gmLang' ); ?></a>
581
+ <a class="btn btn<?php echo ( 'gmedia_tag' == $taxonomy ) ? "-primary active" : '-default'; ?>"
582
+ href="<?php echo add_query_arg( array( 'term' => 'gmedia_tag' ), $url ); ?>"><?php _e( 'Tags', 'gmLang' ); ?></a>
583
+ <a class="btn btn<?php echo ( 'gmedia_category' == $taxonomy ) ? "-primary active" : '-default'; ?>"
584
+ href="<?php echo add_query_arg( array( 'term' => 'gmedia_category' ), $url ); ?>"><?php _e( 'Categories', 'gmLang' ); ?></a>
585
+ </div>
586
+
587
+ </div>
588
+ <div class="panel-body" id="gmedia-msg-panel"><?php echo $alert; ?></div>
589
+ <div class="panel-body" id="gm-list-table">
590
+ <div class="row">
591
+ <div class="col-xs-7 col-md-9" style="padding: 0">
592
+ <div class="list-group" id="gm-list-table" style="margin-bottom:4px;">
593
+ <?php
594
+ if ( count( $gmediaTerms ) ) {
595
+ $author = $gmCore->caps['gmedia_show_others_media'] ? 0 : $user_ID;
596
+ $allow_edit = $gmCore->caps['gmedia_edit_others_media'];
597
+ $gmediaCategories = $gmGallery->options['taxonomies']['gmedia_category'];
598
+ foreach ( $gmediaTerms as $item ) {
599
+ $author_name = $owner = '';
600
+ $list_row_class = $row_class = '';
601
+ $termItems = array();
602
+ $per_page = 10;
603
+ $item_name = $item->name;
604
+ if('gmedia_album' == $taxonomy) {
605
+ $args = array( 'no_found_rows' => true, 'per_page' => $per_page, 'album__in' => array( $item->term_id ), 'author' => $author );
606
+ if ( $item->global ) {
607
+ $owner = get_the_author_meta( 'display_name', $item->global );
608
+ $author_name .= sprintf( __( 'by %s', 'gmLang' ), $owner );
609
+ if ( $item->global == $user_ID ) {
610
+ $row_class .= ' current_user';
611
+ $allow_edit = $gmCore->caps['gmedia_album_manage'];
612
+ } else {
613
+ $row_class .= ' other_user';
614
+ $allow_edit = $gmCore->caps['gmedia_edit_others_media'];
615
+ }
616
+ } else {
617
+ $owner = '&#8212;';
618
+ $author_name .= '(' . __( 'shared', 'gmLang' ) . ')';
619
+ $row_class .= ' shared';
620
+ $allow_edit = $gmCore->caps['gmedia_edit_others_media'];
621
+ }
622
+ if ( 'public' != $item->status ) {
623
+ $author_name .= ' [' . $item->status . ']';
624
+ if ( 'private' == $item->status ) {
625
+ $list_row_class = ' list-group-item-info';
626
+ } elseif ( 'draft' == $item->status ) {
627
+ //$list_row_class = ' list-group-item-warning';
628
+ continue;
629
+ }
630
+ }
631
+ }
632
+ if('gmedia_tag' == $taxonomy){
633
+ $args = array('no_found_rows' => true, 'per_page' => $per_page, 'tag_id' => $item->term_id, 'author' => $author);
634
+ }
635
+ if('gmedia_category' == $taxonomy){
636
+ $args = array('no_found_rows' => true, 'per_page' => $per_page, 'category__in' => $item->term_id, 'author' => $author);
637
+ $item_name = $gmediaCategories[$item_name];
638
+ $allow_edit = false;
639
+ }
640
+
641
+ if ( $item->count ) {
642
+ $termItems = $gmDB->get_gmedias( $args );
643
+ }
644
+ ?>
645
+ <div class="list-group-item term-list-item<?php echo $list_row_class; ?>">
646
+ <div class="row<?php echo $row_class; ?>">
647
+ <div class="term_id">#<?php echo $item->term_id; ?></div>
648
+ <div class="col-xs-5 term-label">
649
+ <div class="no-checkbox">
650
+ <span><?php echo esc_html( $item_name ); ?></span>
651
+ <span class="term_info_author"><?php echo $author_name; ?></span>
652
+ <span class="badge pull-right"><?php echo $item->count; ?></span>
653
+ </div>
654
+ <span class="blank-aligner"></span>
655
+ </div>
656
+ <div class="col-xs-7">
657
+ <div class="term-images">
658
+ <?php if ( ! empty( $termItems ) ) {
659
+ foreach ( $termItems as $i ) {
660
+ ?>
661
+ <img style="z-index:<?php echo $per_page --; ?>;"
662
+ src="<?php echo $gmCore->gm_get_media_image( $i, 'thumb', false ); ?>"
663
+ alt="<?php echo $i->ID; ?>"
664
+ title="<?php echo esc_attr( $i->title ); ?>"/>
665
+ <?php
666
+ }
667
+ }
668
+ if ( count( $termItems ) < $item->count ) {
669
+ echo '...';
670
+ }
671
+ ?>
672
+ </div>
673
+ </div>
674
+ </div>
675
+ <div class="term-info hidden">
676
+ <?php
677
+ $term_meta = $gmDB->get_metadata('gmedia_term', $item->term_id);
678
+ $term_meta = array_map('reset', $term_meta);
679
+ $term_meta = array_merge(array('orderby' => 'ID', 'order' => 'DESC'), $term_meta);
680
+ $tax_name = array(
681
+ 'gmedia_album' => __('Album', 'gmLang'),
682
+ 'gmedia_tag' => __('Tag', 'gmLang'),
683
+ 'gmedia_category' => __('Category', 'gmLang')
684
+ );
685
+ $lib_arg = array(
686
+ 'gmedia_album' => 'alb',
687
+ 'gmedia_tag' => 'tag_id',
688
+ 'gmedia_category' => 'cat'
689
+ );
690
+ ?>
691
+ <input type="hidden" name="taxonomy" value="<?php echo $taxonomy; ?>" />
692
+ <input type="hidden" name="term_id" value="<?php echo $item->term_id; ?>" />
693
+ <p><strong><?php echo $tax_name[$taxonomy]; ?>:</strong> <?php echo esc_html($item_name); ?>
694
+ <br /><strong><?php _e('ID', 'gmLang'); ?>:</strong> <?php echo $item->term_id; ?>
695
+ <?php if('gmedia_album' == $taxonomy){
696
+ $orderby = array(
697
+ 'custom' => __('user defined', 'gmLang'),
698
+ 'ID' => __('by ID', 'gmLang'),
699
+ 'title' => __('by title', 'gmLang'),
700
+ 'date' => __('by date', 'gmLang'),
701
+ 'modified' => __('by last modified date', 'gmLang'),
702
+ 'rand' => __('Random', 'gmLang')
703
+ ); ?>
704
+ <br /><strong><?php _e('Order', 'gmLang'); ?>:</strong> <?php echo $orderby[$term_meta['orderby']]; ?>
705
+ <br /><strong><?php _e('Sort order', 'gmLang'); ?>:</strong> <?php echo $term_meta['order']; ?>
706
+ <br /><strong><?php _e('Status', 'gmLang'); ?>:</strong> <?php echo $item->status; ?>
707
+ <br /><strong><?php _e('Author', 'gmLang'); ?>:</strong> <?php echo $owner; ?>
708
+ <?php } ?>
709
+ </p>
710
+ <p>
711
+ <a href="<?php echo add_query_arg(array('page' => 'GrandMedia', $lib_arg[$taxonomy] => $item->term_id), admin_url('admin.php')); ?>" target="_blank"><?php _e('Open in Gmedia Library', 'gmLang'); ?></a>
712
+ <?php if(('gmedia_album' == $taxonomy) && $allow_edit){ ?>
713
+ &nbsp; | &nbsp; <a href="<?php echo add_query_arg(array('page' => 'GrandMedia_Terms', 'edit_album' => $item->term_id), admin_url('admin.php')); ?>" target="_blank"><?php _e('Edit Album', 'gmLang'); ?></a>
714
+ <?php } ?>
715
+ </p>
716
+ </div>
717
+ <?php if ( ! empty( $item->description ) ) { ?>
718
+ <div class="term-description"><?php echo esc_html( $item->description ); ?></div>
719
+ <?php } ?>
720
+ </div>
721
+ <?php
722
+ }
723
+ } else {
724
+ ?>
725
+ <div class="list-group-item">
726
+ <div class="well well-lg text-center">
727
+ <h4><?php _e( 'No items to show.', 'gmLang' ); ?></h4>
728
+ </div>
729
+ </div>
730
+ <?php } ?>
731
+ </div>
732
+ </div>
733
+ <div class="col-xs-5 col-md-3 media-upload-sidebar">
734
+ <form method="post" id="gmedia-form" role="form">
735
+ <div class="media-upload-form-container">
736
+ <div class="form-group">
737
+ <label><?php _e( 'Choose module/preset', 'gmLang' ); ?></label>
738
+ <select class="form-control input-sm" id="module_preset" name="module_preset" required="required">
739
+ <option value=""><?php _e('Choose module/preset', 'gmLang'); ?></option>
740
+ <?php foreach ( $modules as $mfold => $module ) {
741
+ echo '<optgroup label="' . esc_attr($module['module_title']) . '">';
742
+ $presets = $gmDB->get_terms( 'gmedia_module', array( 'global' => $user_ID, 'status' => $mfold ) );
743
+ $option = array();
744
+ $option['default'] = '<option value="' . esc_attr($mfold) . '">' . '[' . $mfold . '] ' . __( 'Default Settings' ) . '</option>';
745
+ foreach ( $presets as $preset ) {
746
+ if ( '[' . $mfold . ']' == $preset->name ) {
747
+ $option['default'] = '<option value="' . $preset->term_id . '">' . '[' . $mfold . '] ' . __( 'Default Settings' ) . '</option>';
748
+ } else {
749
+ $option[] = '<option value="' . $preset->term_id . '">' . $preset->name . '</option>';
750
+ }
751
+ }
752
+ echo implode('', $option);
753
+ echo '</optgroup>';
754
+ } ?>
755
+ </select>
756
+ </div>
757
+ <div id="media-upload-form-container"></div>
758
+ </div>
759
+ <div class="panel-footer">
760
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>"/>
761
+ <?php wp_nonce_field( 'media-form' ); ?>
762
+ <button type="submit" id="media-upload-form-submit" disabled class="btn btn-primary pull-right" name="gmedia_term_insert"><?php _e( 'Insert into post', 'gmLang' ); ?></button>
763
+ </div>
764
+ </form>
765
+ </div>
766
+ </div>
767
+ </div>
768
+ <script type="text/javascript">
769
+ jQuery(function ($) {
770
+ function divFrame() {
771
+ $('.panel-body').css({top: $('.panel-heading').outerHeight()});
772
+ }
773
 
774
+ divFrame();
775
+ $(window).on('resize', function () {
776
+ divFrame();
777
+ });
778
+ $('.term-list-item').on('click', function () {
779
+ $(this).addClass('active').siblings().removeClass('active');
780
+ var info = $('.term-info', this).clone();
781
+ $('#media-upload-form-container').html(info.html());
782
+ if($('#module_preset').val()) {
783
+ $('#media-upload-form-submit').prop('disabled', false);
784
+ }
785
+ });
786
+ $('#module_preset').on('change', function(){
787
+ if($(this).val() && $('#media-upload-form-container').text()){
788
+ $('#media-upload-form-submit').prop('disabled', false);
789
+ } else{
790
+ $('#media-upload-form-submit').prop('disabled', true);
791
+ }
792
+ });
793
+ });
794
+ </script>
795
+ </div>
796
+ <?php
797
  }
798
 
 
799
 
800
+ function gmedia_add_media_library() {
 
801
 
802
+ global $user_ID, $gmCore, $gmDB, $gmGallery;
 
803
 
804
+ wp_enqueue_style( 'gmedia-bootstrap' );
805
+ wp_enqueue_script( 'gmedia-bootstrap' );
806
 
807
+ wp_enqueue_style( 'grand-media' );
808
+ wp_enqueue_script( 'grand-media' );
809
 
810
+ $post_id = intval( $gmCore->_get( 'post_id' ) );
 
811
 
812
+ if ( current_user_can( 'gmedia_show_others_media' ) ) {
813
  $author = 0;
814
+ } else {
815
  $author = $user_ID;
816
  }
817
+ $args = array(
818
+ 'mime_type' => $gmCore->_get( 'mime_type', 'image/*' ),
819
+ 'author' => $author,
820
+ 'orderby' => 'ID',
821
+ 'order' => 'DESC',
822
+ 'per_page' => 50,
823
+ 'page' => $gmCore->_get( 'pager', 1 ),
824
+ 's' => $gmCore->_get( 's', null )
825
  );
826
+ $gmediaQuery = $gmDB->get_gmedias( $args );
827
 
828
 
829
  ?>
832
  <div class="panel-heading clearfix">
833
  <form class="form-inline gmedia-search-form" role="search">
834
  <div class="form-group">
835
+ <?php foreach ( $_GET as $key => $value ) {
836
+ if ( in_array( $key, array( 'chromeless', 'post_id', 'tab', 'mime_type', 'tag_id', 'tag__in', 'cat', 'category__in', 'alb', 'album__in' ) ) ) {
837
  ?>
838
  <input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>"/>
839
  <?php
840
  }
841
  } ?>
842
+ <input id="gmedia-search" class="form-control input-sm" type="text" name="s" placeholder="<?php _e( 'Search...', 'gmLang' ); ?>" value="<?php echo $gmCore->_get( 's', '' ); ?>"/>
843
  </div>
844
  <button type="submit" class="btn btn-default input-sm"><span class="glyphicon glyphicon-search"></span></button>
845
  </form>
850
  <div class="row">
851
  <div class="col-xs-7 col-md-9" style="text-align:justify;">
852
  <?php
853
+ if ( count( $gmediaQuery ) ) {
854
+ foreach ( $gmediaQuery as $item ) {
855
+ $meta = $gmDB->get_metadata( 'gmedia', $item->ID );
856
+ $type = explode( '/', $item->mime_type );
857
 
858
  /*
859
  $item_url = $gmCore->upload['url'] . '/' . $gmGallery->options['folder'][$type[0]] . '/' . $item->gmuid;
873
  */
874
  ?>
875
  <form class="thumbnail" id="list-item-<?php echo $item->ID; ?>" data-id="<?php echo $item->ID; ?>" data-type="<?php echo $type[0]; ?>">
876
+ <img src="<?php echo $gmCore->gm_get_media_image( $item, 'thumb' ); ?>" style="height:100px;width:auto;" alt=""/>
877
  <span class="glyphicon glyphicon-ok text-success"></span>
878
 
879
  <div class="media-upload-form" style="display:none;">
880
  <input name="ID" type="hidden" value="<?php echo $item->ID; ?>"/>
881
 
882
  <div class="form-group">
883
+ <label><?php _e( 'Title', 'gmLang' ); ?></label>
884
+ <input name="title" type="text" class="form-control input-sm" placeholder="<?php _e( 'Title', 'gmLang' ); ?>" value="<?php echo esc_attr( $item->title ); ?>">
885
  </div>
886
  <div class="form-group">
887
+ <label><?php _e( 'Link To', 'gmLang' ); ?></label>
888
  <select id="gmedia_url" class="form-control input-sm" style="display:block;margin-bottom:5px;">
889
+ <option value="customurl" selected="selected"><?php _e( 'Custom URL' ); ?></option>
890
+ <option value="weburl"><?php _e( 'Web size image' ); ?></option>
891
+ <option value="originalurl"><?php _e( 'Original image' ); ?></option>
892
  </select>
893
  <input name="link" type="text" class="customurl form-control input-sm" value="<?php echo $item->link; ?>" placeholder="http://"/>
894
  <input name="link" type="text" style="display:none;font-size:80%;" readonly="readonly" disabled="disabled" class="weburl form-control input-sm" value="<?php echo $gmCore->upload['url'] . '/' . $gmGallery->options['folder']['image'] . '/' . $item->gmuid; ?>"/>
895
  <input name="link" type="text" style="display:none;font-size:80%;" readonly="readonly" disabled="disabled" class="originalurl form-control input-sm" value="<?php echo $gmCore->upload['url'] . '/' . $gmGallery->options['folder']['image_original'] . '/' . $item->gmuid; ?>"/>
896
  </div>
897
  <div class="form-group">
898
+ <label><?php _e( 'Description', 'gmLang' ); ?></label>
899
+ <textarea name="description" class="form-control input-sm" rows="4" cols="10"><?php echo esc_html( $item->description ); ?></textarea>
900
  </div>
901
  <?php //if($is_webimage){ ?>
902
+ <?php if ( 'image' == $type[0] ) {
903
+ $_metadata = unserialize( $meta['_metadata'][0] ); ?>
904
  <div class="form-group">
905
+ <label><?php _e( 'Size', 'gmLang' ); ?></label>
906
  <select name="size" class="form-control input-sm">
907
  <option value="thumb"><?php echo 'Thumb - ' . $_metadata['thumb']['width'] . ' × ' . $_metadata['thumb']['height']; ?></option>
908
  <option value="web" selected="selected"><?php echo 'Web - ' . $_metadata['web']['width'] . ' × ' . $_metadata['web']['height']; ?></option>
912
  <?php } ?>
913
  <?php //} ?>
914
  <div class="form-group">
915
+ <label><?php _e( 'Alignment', 'gmLang' ); ?></label>
916
  <select name="align" class="form-control input-sm">
917
+ <option value="none" selected="selected"><?php _e( 'None', 'gmLang' ); ?></option>
918
+ <option value="left"><?php _e( 'Left', 'gmLang' ); ?></option>
919
+ <option value="center"><?php _e( 'Center', 'gmLang' ); ?></option>
920
+ <option value="right"><?php _e( 'Right', 'gmLang' ); ?></option>
921
  </select>
922
  </div>
923
  </div>
924
  </form>
925
  <?php
926
  }
927
+ } else {
928
  ?>
929
  <div class="list-group-item">
930
  <div class="well well-lg text-center">
931
+ <h4><?php _e( 'No items to show.', 'gmLang' ); ?></h4>
932
+ <?php if ( $gmCore->caps['gmedia_upload'] ) { ?>
933
  <p>
934
+ <a target="_blank" href="<?php echo admin_url( 'admin.php?page=GrandMedia_AddMedia' ) ?>" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> <?php _e( 'Add Media', 'gmLang' ); ?>
935
  </a></p>
936
  <?php } ?>
937
  </div>
940
  </div>
941
  <div class="col-xs-5 col-md-3 media-upload-sidebar">
942
  <form method="post" id="gmedia-form" role="form">
943
+ <div id="media-upload-form-container" class="media-upload-form-container"></div>
944
  <div class="panel-footer">
945
  <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>"/>
946
+ <?php wp_nonce_field( 'media-form' ); ?>
947
+ <button type="submit" id="media-upload-form-submit" disabled class="btn btn-primary pull-right" name="gmedia_library_insert"><?php _e( 'Insert into post', 'gmLang' ); ?></button>
948
+ <?php if ( $post_id && current_theme_supports( 'post-thumbnails', get_post_type( $post_id ) ) ) { ?>
949
+ <a id="gmedia-post-thumbnail" class="btn disabled" href="javascript:void(0);"><?php _e( 'Use as featured image', 'gmLang' ); ?></a>
950
+ <?php } ?>
951
  </div>
952
  </form>
953
  </div>
954
  </div>
955
  </div>
956
  <script type="text/javascript">
957
+ jQuery(function ($) {
958
+ function divFrame() {
959
  $('.panel-body').css({top: $('.panel-heading').outerHeight()});
960
  }
961
 
962
  divFrame();
963
+ $(window).on('resize', function () {
964
  divFrame();
965
  });
966
+ $('.thumbnail').on('click', function () {
967
+ var form = $('#media-upload-form-container');
968
+ var but = $('.panel-footer .btn');
969
+ if ($(this).hasClass('active')) {
970
  $(this).removeClass('active');
971
+ form.empty();
972
+ but.prop('disabled', true).addClass('disabled');
973
  return;
974
  }
975
  $(this).addClass('active').siblings().removeClass('active');
976
+ form.html($('.media-upload-form', this).html());
977
+ but.prop('disabled', false).removeClass('disabled');
978
  });
979
+ $('#gmedia-form').on('change', '#gmedia_url', function () {
980
  var val = $(this).val();
981
  $(this).nextAll('input.' + val).show().prop('disabled', false).siblings('input').hide().prop('disabled', true);
982
  });
983
+
984
+ <?php
985
+ if ( $post_id && current_theme_supports( 'post-thumbnails', get_post_type( $post_id ) ) ){
986
+ $featured_nonce = wp_create_nonce( "set_post_thumbnail-$post_id" );
987
+ ?>
988
+
989
+ $('#gmedia-post-thumbnail').on('click', function () {
990
+ if ($(this).hasClass('disabled')) {
991
+ return false;
992
+ }
993
+ var id = $('form.active').data('id');
994
+ $.post(ajaxurl, {
995
+ action: "gmedia_set_post_thumbnail", post_id: '<?php echo $post_id; ?>', img_id: id, _wpnonce: '<?php echo $featured_nonce; ?>'
996
+ }, function (str) {
997
+ var win = window.dialogArguments || opener || parent || top;
998
+ if (str == '0') {
999
+ alert(win.setPostThumbnailL10n.error);
1000
+ } else if (str == '-1') {
1001
+ // image removed
1002
+ } else {
1003
+ win.WPSetThumbnailID(id);
1004
+ win.WPSetThumbnailHTML(str);
1005
+ }
1006
+ $('#__gm-uploader', win.document).css('display', 'none');
1007
+ }
1008
+ );
1009
+ });
1010
+
1011
+ <?php } ?>
1012
+ });
1013
+ </script>
1014
+ </div>
1015
+ <?php
1016
+ }
1017
+
1018
+ function gmedia_add_media_upload() {
1019
+
1020
+ global $gmCore, $gmDB, $gmProcessor, $gmGallery, $user_ID;
1021
+
1022
+ if ( ! current_user_can( 'gmedia_upload' ) ) {
1023
+ _e( 'You do not have permissions to upload media', 'gmLang' );
1024
+
1025
+ return;
1026
+ }
1027
+
1028
+ $maxupsize = wp_max_upload_size();
1029
+ $maxupsize = floor( $maxupsize * 0.99 );
1030
+ $maxupsize_mb = floor( $maxupsize / 1024 / 1024 );
1031
+
1032
+ $gm_screen_options = $gmProcessor->user_options();
1033
+
1034
+ ?>
1035
+ <div class="panel panel-default">
1036
+ <div class="panel-body" style="top:0">
1037
+ <form class="row" id="gmUpload" name="upload_form" method="POST" accept-charset="utf-8" onsubmit="return false;">
1038
+ <div class="col-md-4" id="uploader_multipart_params">
1039
+ <div id="gmedia-msg-panel"></div>
1040
+ <br/>
1041
+ <?php if ( 'false' == $gm_screen_options['uploader_chunking'] || ( 'html4' == $gm_screen_options['uploader_runtime'] ) ) { ?>
1042
+ <p class="clearfix text-right"><span class="label label-default"><?php echo __( 'Maximum file size', 'gmLang' ) . ": {$maxupsize_mb}Mb"; ?></span></p>
1043
+ <?php } else { ?>
1044
+ <p class="clearfix text-right hidden">
1045
+ <span class="label label-default"><?php echo __( 'Maximum $_POST size', 'gmLang' ) . ": {$maxupsize_mb}Mb"; ?></span>
1046
+ <span class="label label-default"><?php echo __( 'Chunk size', 'gmLang' ) . ': ' . min( $maxupsize_mb, $gm_screen_options['uploader_chunk_size'] ) . 'Mb'; ?></span>
1047
+ </p>
1048
+ <?php } ?>
1049
+
1050
+ <div class="form-group">
1051
+ <label><?php _e( 'Title', 'gmLang' ); ?></label>
1052
+ <select name="set_title" class="form-control input-sm">
1053
+ <option value="exif"><?php _e( 'EXIF or File Name', 'gmLang' ); ?></option>
1054
+ <option value="filename"><?php _e( 'File Name', 'gmLang' ); ?></option>
1055
+ <option value="empty"><?php _e( 'Empty', 'gmLang' ); ?></option>
1056
+ </select>
1057
+ </div>
1058
+ <div class="form-group">
1059
+ <label><?php _e( 'Status', 'gmLang' ); ?></label>
1060
+ <select name="set_status" class="form-control input-sm">
1061
+ <option value="inherit"><?php _e( 'Same as Album or Public', 'gmLang' ); ?></option>
1062
+ <option value="public"><?php _e( 'Public', 'gmLang' ); ?></option>
1063
+ <option value="private"><?php _e( 'Private', 'gmLang' ); ?></option>
1064
+ <option value="draft"><?php _e( 'Draft', 'gmLang' ); ?></option>
1065
+ </select>
1066
+ </div>
1067
+
1068
+ <hr/>
1069
+
1070
+ <?php if ( $gmCore->caps['gmedia_terms'] ) { ?>
1071
+ <div class="form-group">
1072
+ <?php
1073
+ $term_type = 'gmedia_category';
1074
+ $gm_terms = $gmGallery->options['taxonomies'][ $term_type ];
1075
+
1076
+ $terms_category = '';
1077
+ if ( count( $gm_terms ) ) {
1078
+ foreach ( $gm_terms as $term_name => $term_title ) {
1079
+ $terms_category .= '<option value="' . $term_name . '">' . esc_html( $term_title ) . '</option>' . "\n";
1080
+ }
1081
+ }
1082
+ ?>
1083
+ <label><?php _e( 'Assign Category', 'gmLang' ); ?>
1084
+ <small><?php _e( '(for images only)' ) ?></small>
1085
+ </label>
1086
+ <select id="gmedia_category" name="terms[gmedia_category]" class="form-control input-sm">
1087
+ <option value=""><?php _e( 'Uncategorized', 'gmLang' ); ?></option>
1088
+ <?php echo $terms_category; ?>
1089
+ </select>
1090
+ </div>
1091
+ <div class="form-group">
1092
+ <?php
1093
+ $term_type = 'gmedia_album';
1094
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'global' => array( 0, $user_ID ), 'orderby' => 'global_desc_name' ) );
1095
+
1096
+ $terms_album = '';
1097
+ if ( count( $gm_terms ) ) {
1098
+ foreach ( $gm_terms as $term ) {
1099
+ $terms_album .= '<option value="' . esc_attr( $term->term_id ) . '">' . esc_html( $term->name ) . ( $term->global ? '' : __( ' (shared)', 'gmLang' ) ) . ( 'public' == $term->status ? '' : " [{$term->status}]" ) . '</option>' . "\n";
1100
+ }
1101
+ }
1102
+ ?>
1103
+ <label><?php _e( 'Add to Album', 'gmLang' ); ?> </label>
1104
+ <select id="combobox_gmedia_album" name="terms[gmedia_album]" class="form-control input-sm" placeholder="<?php _e( 'Album Name...', 'gmLang' ); ?>">
1105
+ <option value=""></option>
1106
+ <?php echo $terms_album; ?>
1107
+ </select>
1108
+ </div>
1109
+ <div class="form-group" style="margin-bottom: 210px;">
1110
+ <?php
1111
+ $term_type = 'gmedia_tag';
1112
+ $gm_terms = $gmDB->get_terms( $term_type, array( 'fields' => 'names' ) );
1113
+ ?>
1114
+ <label><?php _e( 'Add Tags', 'gmLang' ); ?> </label>
1115
+ <input id="combobox_gmedia_tag" name="terms[gmedia_tag]" class="form-control input-sm" value="" placeholder="<?php _e( 'Add Tags...', 'gmLang' ); ?>"/>
1116
+ </div>
1117
+ <?php } else { ?>
1118
+ <p><?php _e( 'You are not allowed to assign terms', 'gmLang' ) ?></p>
1119
+ <?php } ?>
1120
+
1121
+ <script type="text/javascript">
1122
+ jQuery(function ($) {
1123
+ <?php if($gmCore->caps['gmedia_terms']){ ?>
1124
+ $('#combobox_gmedia_album').selectize({
1125
+ <?php if($gmCore->caps['gmedia_album_manage']){ ?>
1126
+ create: true,
1127
+ createOnBlur: true,
1128
+ <?php } else{ ?>
1129
+ create: false,
1130
+ <?php } ?>
1131
+ persist: false
1132
+ });
1133
+ var gm_terms = <?php echo json_encode($gm_terms); ?>;
1134
+ var items = gm_terms.map(function (x) {
1135
+ return {item: x};
1136
+ });
1137
+ $('#combobox_gmedia_tag').selectize({
1138
+ <?php if($gmCore->caps['gmedia_tag_manage']){ ?>
1139
+ create: function (input) {
1140
+ return {
1141
+ item: input
1142
+ }
1143
+ },
1144
+ createOnBlur: true,
1145
+ <?php } else{ ?>
1146
+ create: false,
1147
+ <?php } ?>
1148
+ delimiter: ',',
1149
+ maxItems: null,
1150
+ openOnFocus: false,
1151
+ persist: false,
1152
+ options: items,
1153
+ labelField: 'item',
1154
+ valueField: 'item',
1155
+ hideSelected: true
1156
+ });
1157
+ <?php } ?>
1158
+ $('#uploader_runtime select').change(function () {
1159
+ if ('html4' == $(this).val()) {
1160
+ $('#uploader_chunking').addClass('hide');
1161
+ $('#uploader_urlstream_upload').addClass('hide');
1162
+ } else {
1163
+ $('#uploader_chunking').removeClass('hide');
1164
+ $('#uploader_urlstream_upload').removeClass('hide');
1165
+ }
1166
+ });
1167
  });
1168
  </script>
1169
  </div>
1170
+ <div class="col-md-8" id="pluploadUploader" style="padding: 0;">
1171
+ <p><?php _e( "You browser doesn't have Flash or HTML5 support. Check also if page have no JavaScript errors.", 'gmLang' ); ?></p>
1172
+ <?php
1173
+ $mime_types = get_allowed_mime_types( $user_ID );
1174
+ $type_ext = array();
1175
+ $filters = array();
1176
+ foreach ( $mime_types as $ext => $mime ) {
1177
+ $type = strtok( $mime, '/' );
1178
+ $type_ext[ $type ][] = $ext;
1179
+ }
1180
+ foreach ( $type_ext as $filter => $ext ) {
1181
+ $filters[] = array(
1182
+ 'title' => $filter,
1183
+ 'extensions' => str_replace( '|', ',', implode( ',', $ext ) )
1184
+ );
1185
+ }
1186
+ ?>
1187
+ <script type="text/javascript">
1188
+ // Convert divs to queue widgets when the DOM is ready
1189
+ jQuery(function ($) {
1190
+ $("#pluploadUploader").plupload({
1191
+ <?php if('auto' != $gm_screen_options['uploader_runtime']){ ?>
1192
+ runtimes: '<?php echo $gm_screen_options['uploader_runtime']; ?>',
1193
+ <?php } ?>
1194
+ url: '<?php echo wp_nonce_url($gmCore->gmedia_url . '/admin/upload.php', 'grandMedia' ); ?>',
1195
+ <?php if(('true' == $gm_screen_options['uploader_urlstream_upload']) && ('html4' != $gm_screen_options['uploader_runtime'])){ ?>
1196
+ urlstream_upload: true,
1197
+ multipart: false,
1198
+ <?php } else{ ?>
1199
+ multipart: true,
1200
+ <?php } ?>
1201
+ multipart_params: {params: ''},
1202
+ <?php if('true' == $gm_screen_options['uploader_chunking'] && ('html4' != $gm_screen_options['uploader_runtime'])){ ?>
1203
+ max_file_size: '2000Mb',
1204
+ chunk_size: 200000<?php //echo min($maxupsize, $gm_screen_options['uploader_chunk_size']*1024*1024); ?>,
1205
+ <?php } else{ ?>
1206
+ max_file_size: <?php echo $maxupsize; ?>,
1207
+ <?php } ?>
1208
+ max_retries: 2,
1209
+ unique_names: false,
1210
+ rename: true,
1211
+ sortable: true,
1212
+ dragdrop: true,
1213
+ views: {
1214
+ list: true,
1215
+ thumbs: true,
1216
+ active: 'thumbs'
1217
+ },
1218
+ filters: <?php echo json_encode($filters); ?>,
1219
+ flash_swf_url: '<?php echo $gmCore->gmedia_url; ?>/assets/plupload/Moxie.swf',
1220
+ silverlight_xap_url: '<?php echo $gmCore->gmedia_url; ?>/assets/plupload/Moxie.xap'
1221
+
1222
+ });
1223
+ var closebtn = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
1224
+ var uploader = $("#pluploadUploader").plupload('getUploader');
1225
+ uploader.bind('StateChanged', function (up) {
1226
+ if (up.state == plupload.STARTED) {
1227
+ up.settings.multipart_params = {params: jQuery('#uploader_multipart_params :input').serialize()};
1228
+ }
1229
+ console.log('[StateChanged]', up.state, up.settings.multipart_params);
1230
+ });
1231
+ uploader.bind('ChunkUploaded', function (up, file, info) {
1232
+ console.log('[ChunkUploaded] File:', file, "Info:", info);
1233
+ var response = $.parseJSON(info.response);
1234
+ if (response && response.error) {
1235
+ up.stop();
1236
+ file.status = plupload.FAILED;
1237
+ $('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gmedia-msg-panel');
1238
+ console.log(response.error);
1239
+ up.trigger('QueueChanged StateChanged');
1240
+ up.trigger('UploadProgress', file);
1241
+ up.start();
1242
+ }
1243
+ });
1244
+ uploader.bind('FileUploaded', function (up, file, info) {
1245
+ console.log('[FileUploaded] File:', file, "Info:", info);
1246
+ var response = jQuery.parseJSON(info.response);
1247
+ if (response && response.error) {
1248
+ file.status = plupload.FAILED;
1249
+ $('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gmedia-msg-panel');
1250
+ console.log(response.error);
1251
+ }
1252
+ });
1253
+ uploader.bind('UploadProgress', function (up, file) {
1254
+ var percent = uploader.total.percent;
1255
+ $('#total-progress-info .progress-bar').css('width', percent + "%").attr('aria-valuenow', percent);
1256
+ });
1257
+ uploader.bind('Error', function (up, args) {
1258
+ console.log('[Error] ', args);
1259
+ $('<div/>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + args.file.name + ':</strong> ' + args.message + ' ' + args.status).appendTo('#gmedia-msg-panel');
1260
+ });
1261
+ uploader.bind('UploadComplete', function (up, files) {
1262
+ console.log('[UploadComplete]', files);
1263
+ $('<div/>').addClass('alert alert-success alert-dismissable').html(closebtn + "<?php echo esc_attr(__('Upload finished', 'gmLang')); ?>").appendTo('#gmedia-msg-panel');
1264
+ $('#total-progress-info .progress-bar').css('width', '0').attr('aria-valuenow', '0');
1265
+ });
1266
+
1267
+ });
1268
+ </script>
1269
+ </div>
1270
+ </form>
1271
+ </div>
1272
+ </div>
1273
  <?php
1274
  }
1275
+
inc/module.options.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php if(!defined('GMEDIA_VERSION')){
2
- exit('No direct script access allowed');
3
  }
4
 
5
  /**
6
  * @param $options_tree
7
  */
8
- function gmedia_gallery_options_nav($options_tree){
9
  $i = 0;
10
- foreach($options_tree as $section){
11
- $i++;
12
  echo '<li><a href="#gallery_settings' . $i . '" data-toggle="tab">' . $section['label'] . '</a></li>';
13
  }
14
  }
@@ -18,48 +18,48 @@ function gmedia_gallery_options_nav($options_tree){
18
  * @param $default
19
  * @param array $value
20
  */
21
- function gmedia_gallery_options_fieldset($options_tree, $default, $value = array()){
22
  $i = 0;
23
- foreach($options_tree as $section){
24
- $i++;
25
  ?>
26
  <fieldset id="gallery_settings<?php echo $i; ?>" class="tab-pane">
27
  <?php
28
- foreach($section['fields'] as $name => $field){
29
- if('textblock' == $field['tag']){
30
  $args = array(
31
- 'id' => $name,
32
  'field' => $field
33
  );
34
- } else{
35
- if(isset($section['key'])){
36
  $key = $section['key'];
37
- if(!isset($default[$key][$name])){
38
- $default[$key][$name] = false;
39
  }
40
- $val = isset($value[$key][$name])? $value[$key][$name] : $default[$key][$name];
41
  $args = array(
42
- 'id' => strtolower("{$key}_{$name}"),
43
- 'name' => "module[{$key}][{$name}]",
44
- 'field' => $field,
45
- 'value' => $val,
46
- 'default' => $default[$key][$name]
47
  );
48
- } else{
49
- if(!isset($default[$name])){
50
- $default[$name] = false;
51
  }
52
- $val = isset($value[$name])? $value[$name] : $default[$name];
53
  $args = array(
54
- 'id' => strtolower($name),
55
- 'name' => "module[{$name}]",
56
- 'field' => $field,
57
- 'value' => $val,
58
- 'default' => $default[$name]
59
  );
60
  }
61
  }
62
- gmedia_gallery_options_formgroup($args);
63
  }
64
  ?>
65
  </fieldset>
@@ -70,7 +70,7 @@ function gmedia_gallery_options_fieldset($options_tree, $default, $value = array
70
  /**
71
  * @param $args
72
  */
73
- function gmedia_gallery_options_formgroup($args){
74
  /**
75
  * @var $id
76
  * @var $name
@@ -78,48 +78,48 @@ function gmedia_gallery_options_formgroup($args){
78
  * @var $value
79
  * @var $default
80
  */
81
- extract($args);
82
- if('input' == $field['tag']){
83
  ?>
84
  <div class="form-group" id="div_<?php echo $id; ?>">
85
  <label><?php echo $field['label']; ?></label>
86
- <input <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm" name="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" data-value="<?php echo $default; ?>" placeholder="<?php echo $default; ?>"/>
87
- <?php if(!empty($field['text'])){
88
  echo "<p class='help-block'>{$field['text']}</p>";
89
  } ?>
90
  </div>
91
- <?php } elseif('checkbox' == $field['tag']){ ?>
92
  <div class="form-group" id="div_<?php echo $id; ?>">
93
  <div class="checkbox">
94
  <input type="hidden" name="<?php echo $name; ?>" value="0"/>
95
- <label><input type="checkbox" <?php echo $field['attr']; ?> id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="1" data-value="<?php echo $default; ?>" <?php echo checked($value, '1'); ?>/> <?php echo $field['label']; ?>
96
  </label>
97
- <?php if(!empty($field['text'])){
98
  echo "<p class='help-block'>{$field['text']}</p>";
99
  } ?>
100
  </div>
101
  </div>
102
- <?php } elseif('select' == $field['tag']){ ?>
103
  <div class="form-group" id="div_<?php echo $id; ?>">
104
  <label><?php echo $field['label']; ?></label>
105
  <select <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm" name="<?php echo $name; ?>" data-value="<?php echo $default; ?>">
106
- <?php foreach($field['choices'] as $choice){ ?>
107
- <option value="<?php echo esc_attr($choice['value']); ?>" <?php echo selected($value, $choice['value']); ?>><?php echo $choice['label']; ?></option>
108
  <?php } ?>
109
  </select>
110
- <?php if(!empty($field['text'])){
111
  echo "<p class='help-block'>{$field['text']}</p>";
112
  } ?>
113
  </div>
114
- <?php } elseif('textarea' == $field['tag']){ ?>
115
  <div class="form-group" id="div_<?php echo $id; ?>">
116
  <label><?php echo $field['label']; ?></label>
117
- <textarea <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm" name="<?php echo $name; ?>"><?php echo esc_html($value); ?></textarea>
118
- <?php if(!empty($field['text'])){
119
  echo "<p class='help-block'>{$field['text']}</p>";
120
  } ?>
121
  </div>
122
- <?php } elseif('textblock' == $field['tag']){ ?>
123
  <div class="text-block">
124
  <?php echo $field['label']; ?>
125
  <?php echo $field['text']; ?>
@@ -137,21 +137,21 @@ function gmedia_gallery_options_formgroup($args){
137
  *
138
  * @return array
139
  */
140
- if(!function_exists('gm_recognized_font_styles')){
141
 
142
  /**
143
  * @param string $field_id
144
  *
145
  * @return mixed|void
146
  */
147
- function gm_recognized_font_styles($field_id = ''){
148
 
149
- return apply_filters('gm_recognized_font_styles', array(
150
- 'normal' => 'Normal',
151
- 'italic' => 'Italic',
152
  'oblique' => 'Oblique',
153
  'inherit' => 'Inherit'
154
- ), $field_id);
155
 
156
  }
157
 
@@ -165,31 +165,31 @@ if(!function_exists('gm_recognized_font_styles')){
165
  *
166
  * @return array
167
  */
168
- if(!function_exists('gm_recognized_font_weights')){
169
 
170
  /**
171
  * @param string $field_id
172
  *
173
  * @return mixed|void
174
  */
175
- function gm_recognized_font_weights($field_id = ''){
176
 
177
- return apply_filters('gm_recognized_font_weights', array(
178
- 'normal' => 'Normal',
179
- 'bold' => 'Bold',
180
- 'bolder' => 'Bolder',
181
  'lighter' => 'Lighter',
182
- '100' => '100',
183
- '200' => '200',
184
- '300' => '300',
185
- '400' => '400',
186
- '500' => '500',
187
- '600' => '600',
188
- '700' => '700',
189
- '800' => '800',
190
- '900' => '900',
191
  'inherit' => 'Inherit'
192
- ), $field_id);
193
 
194
  }
195
 
@@ -203,20 +203,20 @@ if(!function_exists('gm_recognized_font_weights')){
203
  *
204
  * @return array
205
  */
206
- if(!function_exists('gm_recognized_font_variants')){
207
 
208
  /**
209
  * @param string $field_id
210
  *
211
  * @return mixed|void
212
  */
213
- function gm_recognized_font_variants($field_id = ''){
214
 
215
- return apply_filters('gm_recognized_font_variants', array(
216
- 'normal' => 'Normal',
217
  'small-caps' => 'Small Caps',
218
- 'inherit' => 'Inherit'
219
- ), $field_id);
220
 
221
  }
222
 
@@ -232,25 +232,25 @@ if(!function_exists('gm_recognized_font_variants')){
232
  *
233
  * @return array
234
  */
235
- if(!function_exists('gm_recognized_font_families')){
236
 
237
  /**
238
  * @param string $field_id
239
  *
240
  * @return mixed|void
241
  */
242
- function gm_recognized_font_families($field_id = ''){
243
 
244
- return apply_filters('gm_recognized_font_families', array(
245
- 'arial' => 'Arial',
246
- 'georgia' => 'Georgia',
247
  'helvetica' => 'Helvetica',
248
- 'palatino' => 'Palatino',
249
- 'tahoma' => 'Tahoma',
250
- 'times' => '"Times New Roman", sans-serif',
251
  'trebuchet' => 'Trebuchet',
252
- 'verdana' => 'Verdana'
253
- ), $field_id);
254
 
255
  }
256
 
1
+ <?php if ( ! defined( 'GMEDIA_VERSION' ) ) {
2
+ exit( 'No direct script access allowed' );
3
  }
4
 
5
  /**
6
  * @param $options_tree
7
  */
8
+ function gmedia_gallery_options_nav( $options_tree ) {
9
  $i = 0;
10
+ foreach ( $options_tree as $section ) {
11
+ $i ++;
12
  echo '<li><a href="#gallery_settings' . $i . '" data-toggle="tab">' . $section['label'] . '</a></li>';
13
  }
14
  }
18
  * @param $default
19
  * @param array $value
20
  */
21
+ function gmedia_gallery_options_fieldset( $options_tree, $default, $value = array() ) {
22
  $i = 0;
23
+ foreach ( $options_tree as $section ) {
24
+ $i ++;
25
  ?>
26
  <fieldset id="gallery_settings<?php echo $i; ?>" class="tab-pane">
27
  <?php
28
+ foreach ( $section['fields'] as $name => $field ) {
29
+ if ( 'textblock' == $field['tag'] ) {
30
  $args = array(
31
+ 'id' => $name,
32
  'field' => $field
33
  );
34
+ } else {
35
+ if ( isset( $section['key'] ) ) {
36
  $key = $section['key'];
37
+ if ( ! isset( $default[ $key ][ $name ] ) ) {
38
+ $default[ $key ][ $name ] = false;
39
  }
40
+ $val = isset( $value[ $key ][ $name ] ) ? $value[ $key ][ $name ] : $default[ $key ][ $name ];
41
  $args = array(
42
+ 'id' => strtolower( "{$key}_{$name}" ),
43
+ 'name' => "module[{$key}][{$name}]",
44
+ 'field' => $field,
45
+ 'value' => $val,
46
+ 'default' => $default[ $key ][ $name ]
47
  );
48
+ } else {
49
+ if ( ! isset( $default[ $name ] ) ) {
50
+ $default[ $name ] = false;
51
  }
52
+ $val = isset( $value[ $name ] ) ? $value[ $name ] : $default[ $name ];
53
  $args = array(
54
+ 'id' => strtolower( $name ),
55
+ 'name' => "module[{$name}]",
56
+ 'field' => $field,
57
+ 'value' => $val,
58
+ 'default' => $default[ $name ]
59
  );
60
  }
61
  }
62
+ gmedia_gallery_options_formgroup( $args );
63
  }
64
  ?>
65
  </fieldset>
70
  /**
71
  * @param $args
72
  */
73
+ function gmedia_gallery_options_formgroup( $args ) {
74
  /**
75
  * @var $id
76
  * @var $name
78
  * @var $value
79
  * @var $default
80
  */
81
+ extract( $args );
82
+ if ( 'input' == $field['tag'] ) {
83
  ?>
84
  <div class="form-group" id="div_<?php echo $id; ?>">
85
  <label><?php echo $field['label']; ?></label>
86
+ <input <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm" name="<?php echo $name; ?>" value="<?php echo esc_attr( $value ); ?>" data-value="<?php echo $default; ?>" placeholder="<?php echo $default; ?>"/>
87
+ <?php if ( ! empty( $field['text'] ) ) {
88
  echo "<p class='help-block'>{$field['text']}</p>";
89
  } ?>
90
  </div>
91
+ <?php } elseif ( 'checkbox' == $field['tag'] ) { ?>
92
  <div class="form-group" id="div_<?php echo $id; ?>">
93
  <div class="checkbox">
94
  <input type="hidden" name="<?php echo $name; ?>" value="0"/>
95
+ <label><input type="checkbox" <?php echo $field['attr']; ?> id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="1" data-value="<?php echo $default; ?>" <?php echo checked( $value, '1' ); ?>/> <?php echo $field['label']; ?>
96
  </label>
97
+ <?php if ( ! empty( $field['text'] ) ) {
98
  echo "<p class='help-block'>{$field['text']}</p>";
99
  } ?>
100
  </div>
101
  </div>
102
+ <?php } elseif ( 'select' == $field['tag'] ) { ?>
103
  <div class="form-group" id="div_<?php echo $id; ?>">
104
  <label><?php echo $field['label']; ?></label>
105
  <select <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm" name="<?php echo $name; ?>" data-value="<?php echo $default; ?>">
106
+ <?php foreach ( $field['choices'] as $choice ) { ?>
107
+ <option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php echo selected( $value, $choice['value'] ); ?>><?php echo $choice['label']; ?></option>
108
  <?php } ?>
109
  </select>
110
+ <?php if ( ! empty( $field['text'] ) ) {
111
  echo "<p class='help-block'>{$field['text']}</p>";
112
  } ?>
113
  </div>
114
+ <?php } elseif ( 'textarea' == $field['tag'] ) { ?>
115
  <div class="form-group" id="div_<?php echo $id; ?>">
116
  <label><?php echo $field['label']; ?></label>
117
+ <textarea <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm" name="<?php echo $name; ?>"><?php echo esc_html( $value ); ?></textarea>
118
+ <?php if ( ! empty( $field['text'] ) ) {
119
  echo "<p class='help-block'>{$field['text']}</p>";
120
  } ?>
121
  </div>
122
+ <?php } elseif ( 'textblock' == $field['tag'] ) { ?>
123
  <div class="text-block">
124
  <?php echo $field['label']; ?>
125
  <?php echo $field['text']; ?>
137
  *
138
  * @return array
139
  */
140
+ if ( ! function_exists( 'gm_recognized_font_styles' ) ) {
141
 
142
  /**
143
  * @param string $field_id
144
  *
145
  * @return mixed|void
146
  */
147
+ function gm_recognized_font_styles( $field_id = '' ) {
148
 
149
+ return apply_filters( 'gm_recognized_font_styles', array(
150
+ 'normal' => 'Normal',
151
+ 'italic' => 'Italic',
152
  'oblique' => 'Oblique',
153
  'inherit' => 'Inherit'
154
+ ), $field_id );
155
 
156
  }
157
 
165
  *
166
  * @return array
167
  */
168
+ if ( ! function_exists( 'gm_recognized_font_weights' ) ) {
169
 
170
  /**
171
  * @param string $field_id
172
  *
173
  * @return mixed|void
174
  */
175
+ function gm_recognized_font_weights( $field_id = '' ) {
176
 
177
+ return apply_filters( 'gm_recognized_font_weights', array(
178
+ 'normal' => 'Normal',
179
+ 'bold' => 'Bold',
180
+ 'bolder' => 'Bolder',
181
  'lighter' => 'Lighter',
182
+ '100' => '100',
183
+ '200' => '200',
184
+ '300' => '300',
185
+ '400' => '400',
186
+ '500' => '500',
187
+ '600' => '600',
188
+ '700' => '700',
189
+ '800' => '800',
190
+ '900' => '900',
191
  'inherit' => 'Inherit'
192
+ ), $field_id );
193
 
194
  }
195
 
203
  *
204
  * @return array
205
  */
206
+ if ( ! function_exists( 'gm_recognized_font_variants' ) ) {
207
 
208
  /**
209
  * @param string $field_id
210
  *
211
  * @return mixed|void
212
  */
213
+ function gm_recognized_font_variants( $field_id = '' ) {
214
 
215
+ return apply_filters( 'gm_recognized_font_variants', array(
216
+ 'normal' => 'Normal',
217
  'small-caps' => 'Small Caps',
218
+ 'inherit' => 'Inherit'
219
+ ), $field_id );
220
 
221
  }
222
 
232
  *
233
  * @return array
234
  */
235
+ if ( ! function_exists( 'gm_recognized_font_families' ) ) {
236
 
237
  /**
238
  * @param string $field_id
239
  *
240
  * @return mixed|void
241
  */
242
+ function gm_recognized_font_families( $field_id = '' ) {
243
 
244
+ return apply_filters( 'gm_recognized_font_families', array(
245
+ 'arial' => 'Arial',
246
+ 'georgia' => 'Georgia',
247
  'helvetica' => 'Helvetica',
248
+ 'palatino' => 'Palatino',
249
+ 'tahoma' => 'Tahoma',
250
+ 'times' => '"Times New Roman", sans-serif',
251
  'trebuchet' => 'Trebuchet',
252
+ 'verdana' => 'Verdana'
253
+ ), $field_id );
254
 
255
  }
256
 
inc/permalinks.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
- if(!defined('ABSPATH')){
3
  exit;
4
  } // Exit if accessed directly
5
 
6
  /**
7
  * gmediaPermalinks class.
8
  */
9
- class gmediaPermalinks{
10
 
11
  private $endpoint;
12
 
@@ -16,14 +16,15 @@ class gmediaPermalinks{
16
  * @access public
17
  * @return \gmediaPermalinks
18
  */
19
- public function __construct(){
20
  global $gmGallery;
21
- $this->endpoint = (isset($gmGallery->options['endpoint']) && ($endpoint = $gmGallery->options['endpoint']))? $endpoint : 'gmedia';
22
 
23
- add_filter('rewrite_rules_array', array($this, 'add_rewrite_rules'));
24
- add_filter('query_vars', array($this, 'add_query_vars'));
25
- add_action('parse_request', array($this, 'handler'));
26
 
 
27
  }
28
 
29
  /**
@@ -32,9 +33,9 @@ class gmediaPermalinks{
32
  * @access public
33
  * @return void
34
  */
35
- public function add_endpoint(){
36
- add_rewrite_endpoint($this->endpoint, EP_NONE);
37
- add_rewrite_endpoint('gmedia-app', EP_NONE);
38
  //add_rewrite_rule('gmedia(/(gallery|single|album|tag|category))?/(.+?)/?$', 'index.php?gmedia=$matches[3]&type=$matches[2]', 'top');
39
  }
40
 
@@ -43,14 +44,14 @@ class gmediaPermalinks{
43
  *
44
  * @return array
45
  */
46
- function add_rewrite_rules($rules){
47
  global $wp_rewrite;
48
 
49
  $this->add_endpoint();
50
 
51
  $new_rules = array(
52
- $this->endpoint . '(/(gallery|single|album|tag|category))?/(.+?)/?$' => 'index.php?gmedia=' . $wp_rewrite->preg_index(3) . '&type=' . ($wp_rewrite->preg_index(2)? $wp_rewrite->preg_index(2) : 'gallery'),
53
- 'gmedia-app/?$' => 'index.php?gmedia-app=1'
54
  );
55
 
56
  $new_rules = $new_rules + $rules;
@@ -67,7 +68,7 @@ class gmediaPermalinks{
67
  *
68
  * @return array
69
  */
70
- public function add_query_vars($vars){
71
  $vars[] = 'gmedia';
72
  $vars[] = 'type';
73
 
@@ -80,58 +81,79 @@ class gmediaPermalinks{
80
  * @access public
81
  * @return void
82
  */
83
- public function handler(){
84
  global $wp;
85
 
86
- if(isset($_GET['gmedia']) && !empty($_GET['gmedia'])){
87
  $wp->query_vars['gmedia'] = $_GET['gmedia'];
88
  }
89
 
90
- if(isset($_GET['type']) && !empty($_GET['type'])){
91
  $wp->query_vars['type'] = $_GET['type'];
92
  }
93
 
94
- if(isset($wp->query_vars['gmedia']) && !empty($wp->query_vars['gmedia'])){
95
 
96
  global $wp_query;
97
- $wp_query->is_single = false;
98
- $wp_query->is_page = false;
99
  $wp_query->is_archive = false;
100
- $wp_query->is_search = false;
101
- $wp_query->is_home = false;
102
 
103
- $template = get_query_template('gmedia-gallery');
104
  // Get default slug-name.php
105
- if(!$template){
106
  $template = GMEDIA_ABSPATH . "/gallery.php";
107
  }
108
 
109
- load_template($template, false);
110
  exit();
111
 
112
  }
113
 
114
- if(isset($_GET['gmedia-app']) && !empty($_GET['gmedia-app'])){
115
  $wp->query_vars['gmedia-app'] = $_GET['gmedia-app'];
116
  }
117
- if(isset($wp->query_vars['gmedia-app']) && !empty($wp->query_vars['gmedia-app'])){
118
 
119
  global $wp_query;
120
- $wp_query->is_single = false;
121
- $wp_query->is_page = false;
122
  $wp_query->is_archive = false;
123
- $wp_query->is_search = false;
124
- $wp_query->is_home = false;
125
 
126
  $template = GMEDIA_ABSPATH . "/access.php";
127
 
128
- load_template($template, false);
129
  exit();
130
 
131
  }
132
 
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
 
137
  global $gmPermalinks;
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  } // Exit if accessed directly
5
 
6
  /**
7
  * gmediaPermalinks class.
8
  */
9
+ class gmediaPermalinks {
10
 
11
  private $endpoint;
12
 
16
  * @access public
17
  * @return \gmediaPermalinks
18
  */
19
+ public function __construct() {
20
  global $gmGallery;
21
+ $this->endpoint = ( isset( $gmGallery->options['endpoint'] ) && ( $endpoint = $gmGallery->options['endpoint'] ) ) ? $endpoint : 'gmedia';
22
 
23
+ add_filter( 'rewrite_rules_array', array( $this, 'add_rewrite_rules' ) );
24
+ add_filter( 'query_vars', array( $this, 'add_query_vars' ) );
25
+ add_action( 'parse_request', array( $this, 'handler' ) );
26
 
27
+ add_filter( 'post_thumbnail_html', array( $this, 'gmedia_post_thumbnail' ), 10, 5 );
28
  }
29
 
30
  /**
33
  * @access public
34
  * @return void
35
  */
36
+ public function add_endpoint() {
37
+ add_rewrite_endpoint( $this->endpoint, EP_NONE );
38
+ add_rewrite_endpoint( 'gmedia-app', EP_NONE );
39
  //add_rewrite_rule('gmedia(/(gallery|single|album|tag|category))?/(.+?)/?$', 'index.php?gmedia=$matches[3]&type=$matches[2]', 'top');
40
  }
41
 
44
  *
45
  * @return array
46
  */
47
+ function add_rewrite_rules( $rules ) {
48
  global $wp_rewrite;
49
 
50
  $this->add_endpoint();
51
 
52
  $new_rules = array(
53
+ $this->endpoint . '(/(gallery|single|album|tag|category))?/(.+?)/?$' => 'index.php?gmedia=' . $wp_rewrite->preg_index( 3 ) . '&type=' . ( $wp_rewrite->preg_index( 2 ) ? $wp_rewrite->preg_index( 2 ) : 'gallery' ),
54
+ 'gmedia-app/?$' => 'index.php?gmedia-app=1'
55
  );
56
 
57
  $new_rules = $new_rules + $rules;
68
  *
69
  * @return array
70
  */
71
+ public function add_query_vars( $vars ) {
72
  $vars[] = 'gmedia';
73
  $vars[] = 'type';
74
 
81
  * @access public
82
  * @return void
83
  */
84
+ public function handler() {
85
  global $wp;
86
 
87
+ if ( isset( $_GET['gmedia'] ) && ! empty( $_GET['gmedia'] ) ) {
88
  $wp->query_vars['gmedia'] = $_GET['gmedia'];
89
  }
90
 
91
+ if ( isset( $_GET['type'] ) && ! empty( $_GET['type'] ) ) {
92
  $wp->query_vars['type'] = $_GET['type'];
93
  }
94
 
95
+ if ( isset( $wp->query_vars['gmedia'] ) && ! empty( $wp->query_vars['gmedia'] ) ) {
96
 
97
  global $wp_query;
98
+ $wp_query->is_single = false;
99
+ $wp_query->is_page = false;
100
  $wp_query->is_archive = false;
101
+ $wp_query->is_search = false;
102
+ $wp_query->is_home = false;
103
 
104
+ $template = get_query_template( 'gmedia-gallery' );
105
  // Get default slug-name.php
106
+ if ( ! $template ) {
107
  $template = GMEDIA_ABSPATH . "/gallery.php";
108
  }
109
 
110
+ load_template( $template, false );
111
  exit();
112
 
113
  }
114
 
115
+ if ( isset( $_GET['gmedia-app'] ) && ! empty( $_GET['gmedia-app'] ) ) {
116
  $wp->query_vars['gmedia-app'] = $_GET['gmedia-app'];
117
  }
118
+ if ( isset( $wp->query_vars['gmedia-app'] ) && ! empty( $wp->query_vars['gmedia-app'] ) ) {
119
 
120
  global $wp_query;
121
+ $wp_query->is_single = false;
122
+ $wp_query->is_page = false;
123
  $wp_query->is_archive = false;
124
+ $wp_query->is_search = false;
125
+ $wp_query->is_home = false;
126
 
127
  $template = GMEDIA_ABSPATH . "/access.php";
128
 
129
+ load_template( $template, false );
130
  exit();
131
 
132
  }
133
 
134
  }
135
 
136
+ /**
137
+ * Filter for the post content
138
+ *
139
+ * @param string $html
140
+ * @param int $post_id
141
+ * @param int $post_thumbnail_id
142
+ * @param string|array $size Optional. Image size. Defaults to 'thumbnail'.
143
+ * @param string|array $attr Optional. Query string or array of attributes.
144
+ *
145
+ * @return string html output
146
+ */
147
+ function gmedia_post_thumbnail( $html, $post_id, $post_thumbnail_id, $size = 'post-thumbnail', $attr = '' ) {
148
+
149
+ $gmedia_id = get_post_meta( $post_thumbnail_id, '_gmedia_image_id', true );
150
+ if ( ! empty( $gmedia_id ) ) {
151
+ $html = str_replace( 'wp-post-image', 'wp-post-image gmedia-post-thumbnail-' . $gmedia_id, $html );
152
+ }
153
+
154
+ return $html;
155
+ }
156
+
157
  }
158
 
159
  global $gmPermalinks;
inc/post-metabox.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
3
- die('You are not allowed to call this page directly.');
4
  }
5
 
6
  /**
@@ -9,52 +9,34 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
9
  * @param string $page the name of the current page
10
  * @param string $context the current context
11
  */
12
- function gmedia_add_meta_box($page, $context){
13
- if(!current_user_can('gmedia_gallery_manage')){
14
  return;
15
  }
16
  // Plugins that use custom post types can use this filter to show the Gmedia UI in their post type.
17
- $gm_post_types = apply_filters('gmedia-post-types', array('post', 'page'));
18
 
19
- if(function_exists('add_meta_box') && !empty($gm_post_types) && in_array($page, $gm_post_types) && 'side' === $context){
20
- add_action('admin_enqueue_scripts', 'gmedia_meta_box_load_scripts', 20);
21
- add_filter('media_buttons_context', 'gmedia_media_buttons_context', 4);
22
- add_meta_box('gmedia-MetaBox', __('Gmedia Gallery MetaBox', 'gmLang'), 'gmedia_post_metabox', $page, 'side', 'low');
23
  }
 
24
  }
25
 
26
- add_action('do_meta_boxes', 'gmedia_add_meta_box', 20, 2);
27
 
28
  /**
29
  * @param $hook
30
  */
31
- function gmedia_meta_box_load_scripts($hook){
32
- if((in_array($hook, array(
33
- 'post.php',
34
- 'edit.php'
35
- )) && isset($_GET['post']) && isset($_GET['action']) && $_GET['action'] == 'edit') || $hook == 'post-new.php'
36
- ){
37
- wp_enqueue_style('wp-jquery-ui-dialog');
38
- wp_enqueue_style('gmedia-meta-box', plugins_url(GMEDIA_FOLDER) . '/admin/css/meta-box.css', array('wp-jquery-ui-dialog'), '0.9.0');
39
- wp_enqueue_script('gmedia-meta-box', plugins_url(GMEDIA_FOLDER) . '/admin/js/meta-box.js', array(
40
- 'jquery',
41
- 'jquery-ui-dialog',
42
- 'gmedia-global-backend'
43
- ), '0.9.0', true);
44
  }
45
  }
46
 
47
- /**
48
- * @param $context
49
- *
50
- * @return string
51
- */
52
- function gmedia_media_buttons_context($context){
53
- $button = '<a href="#" class="gmedia_button button hidden" onclick="gm_media_button(this); return false;"><span class="wp-media-buttons-icon"></span> ' . __('Gmedia', 'gmLang') . '</a>';
54
-
55
- return $context . $button;
56
- }
57
-
58
  /*
59
  * add_tinymce_plugin()
60
  * Load the TinyMCE plugin : tinymce_gmedia_plugin.js
@@ -72,43 +54,43 @@ return $plugin_array;
72
  //add_filter( 'mce_external_plugins', 'gmedia_tinymce_plugin', 5 );
73
  */
74
 
75
- function gmedia_post_metabox(){
76
  global $gmCore, $gmDB, $user_ID;
77
  $t = $gmCore->gmedia_url . '/admin/images/blank.gif';
78
  ?>
79
  <div id="gmedia-wraper">
80
  <div id="gmedia-message">
81
- <span class="info-init text-info" style="display: none;"><?php _e('Initializing...', 'gmLang'); ?></span>
82
- <span class="info-textarea text-warning" style="display: none;"><?php _e('Choose text area first', 'gmLang'); ?></span>
83
  </div>
84
  <div id="gmedia-source">
85
  <div id="gmedia-galleries">
86
  <div class="title-bar">
87
- <span class="gmedia-galleries-title"><?php _e('Gmedia Galleries', 'gmLang'); ?></span><a title="<?php _e('Create Gallery', 'gmLang'); ?>" class="button button-primary button-small gm-add-button" target="_blank" href="<?php echo admin_url('admin.php?page=GrandMedia_Modules'); ?>"><?php _e('Create Gallery', 'gmLang'); ?></a>
88
  </div>
89
  <div id="gmedia-galleries-wrap">
90
  <ul id="gmedia-galleries-list">
91
  <?php
92
  $taxonomy = 'gmedia_gallery';
93
- if($gmCore->caps['gmedia_edit_others_media']){
94
  $args = array();
95
- } else{
96
- $args = array('global' => $user_ID);
97
  }
98
 
99
- $gmediaTerms = $gmDB->get_terms($taxonomy, $args);
100
 
101
- if(count($gmediaTerms)){
102
- foreach($gmediaTerms as $item){
103
- $module_folder = $gmDB->get_metadata('gmedia_term', $item->term_id, 'module', true);
104
- $module_dir = $gmCore->get_module_path($module_folder);
105
- if(!$module_dir){
106
  continue;
107
  }
108
 
109
  /** @var $module array */
110
  $module_info = array();
111
- include($module_dir['path'] . '/index.php');
112
 
113
  ?>
114
  <li class="gmedia-gallery-li" id="gmGallery-<?php echo $item->term_id; ?>">
@@ -117,38 +99,75 @@ function gmedia_post_metabox(){
117
  </p>
118
 
119
  <p class="gmedia-gallery-source">
120
- <span class="gmedia-gallery-module"><?php echo __('module', 'gmLang') . ': ' . $module_info['title']; ?></span>
121
  </p>
122
 
123
  <div class="gmedia-insert">
124
  <div class="gmedia-remove-button">
125
- <img src="<?php echo $t; ?>" alt=""/><?php _e('click to remove shortcode', 'gmLang'); ?>
126
  <br/>
127
  <small>[gmedia id=<?php echo $item->term_id; ?>]</small>
128
  </div>
129
  <div class="gmedia-insert-button">
130
- <img src="<?php echo $t; ?>" alt=""/><?php _e('click to insert shortcode', 'gmLang'); ?>
131
  <br/>
132
  <small>[gmedia id=<?php echo $item->term_id; ?>]</small>
133
  </div>
134
  </div>
135
  <div class="gmedia-selector"></div>
136
- <a href="<?php echo admin_url("admin.php?page=GrandMedia_Galleries&amp;edit_gallery=" . $item->term_id); ?>"
137
- title="Edit Gallery #<?php echo $item->term_id; ?> in New Window" target="_blank" class="gmedia-gallery-gear"><?php _e('edit', 'gmLang'); ?></a>
138
  </li>
139
  <?php
140
  }
141
- } else{
142
- echo '<li class="emptydb">' . __('No Galleries.', 'gmLang') . ' <a target="_blank" href="' . admin_url('admin.php?page=GrandMedia_Modules') . '">' . __('Create', 'gmLang') . '</a></li>';
143
  }
144
  ?>
145
  </ul>
146
  </div>
147
  </div>
148
  <div id="gmedia-social">
149
- <p><a target="_blank" href="http://wordpress.org/extend/plugins/grand-media/"><?php _e('Rate Gmedia at Wordpress.org', 'gmLang'); ?></a></p>
150
  </div>
151
  </div>
152
  </div>
153
  <?php
154
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
  /**
9
  * @param string $page the name of the current page
10
  * @param string $context the current context
11
  */
12
+ function gmedia_add_meta_box( $page, $context ) {
13
+ if ( ! current_user_can( 'gmedia_library' ) ) {
14
  return;
15
  }
16
  // Plugins that use custom post types can use this filter to show the Gmedia UI in their post type.
17
+ $gm_post_types = apply_filters( 'gmedia-post-types', array( 'post', 'page' ) );
18
 
19
+ if ( function_exists( 'add_meta_box' ) && ! empty( $gm_post_types ) && in_array( $page, $gm_post_types ) && 'side' === $context ) {
20
+ add_action( 'admin_enqueue_scripts', 'gmedia_meta_box_load_scripts', 20 );
21
+ //add_meta_box('gmedia-MetaBox', __('Gmedia Gallery MetaBox', 'gmLang'), 'gmedia_post_metabox', $page, 'side', 'low');
 
22
  }
23
+
24
  }
25
 
26
+ add_action( 'do_meta_boxes', 'gmedia_add_meta_box', 20, 2 );
27
 
28
  /**
29
  * @param $hook
30
  */
31
+ function gmedia_meta_box_load_scripts( $hook ) {
32
+ if ( ( in_array( $hook, array( 'post.php', 'edit.php' ) ) && isset( $_GET['post'] ) && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) || $hook == 'post-new.php' ) {
33
+ //wp_enqueue_style('wp-jquery-ui-dialog');
34
+ //wp_enqueue_style('gmedia-meta-box', plugins_url(GMEDIA_FOLDER) . '/admin/css/meta-box.css', array('wp-jquery-ui-dialog'), '1.3.0');
35
+ //wp_enqueue_script('gmedia-meta-box', plugins_url(GMEDIA_FOLDER) . '/admin/js/meta-box.js', array('jquery','jquery-ui-dialog','gmedia-global-backend'), '1.3.0', true);
36
+ wp_enqueue_script( 'gmedia-meta-box', plugins_url( GMEDIA_FOLDER ) . '/admin/js/meta-box.js', array( 'jquery', 'gmedia-global-backend' ), '1.3.0', true );
 
 
 
 
 
 
 
37
  }
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
40
  /*
41
  * add_tinymce_plugin()
42
  * Load the TinyMCE plugin : tinymce_gmedia_plugin.js
54
  //add_filter( 'mce_external_plugins', 'gmedia_tinymce_plugin', 5 );
55
  */
56
 
57
+ function gmedia_post_metabox() {
58
  global $gmCore, $gmDB, $user_ID;
59
  $t = $gmCore->gmedia_url . '/admin/images/blank.gif';
60
  ?>
61
  <div id="gmedia-wraper">
62
  <div id="gmedia-message">
63
+ <span class="info-init text-info" style="display: none;"><?php _e( 'Initializing...', 'gmLang' ); ?></span>
64
+ <span class="info-textarea text-warning" style="display: none;"><?php _e( 'Choose text area first', 'gmLang' ); ?></span>
65
  </div>
66
  <div id="gmedia-source">
67
  <div id="gmedia-galleries">
68
  <div class="title-bar">
69
+ <span class="gmedia-galleries-title"><?php _e( 'Gmedia Galleries', 'gmLang' ); ?></span><a title="<?php _e( 'Create Gallery', 'gmLang' ); ?>" class="button button-primary button-small gm-add-button" target="_blank" href="<?php echo admin_url( 'admin.php?page=GrandMedia_Modules' ); ?>"><?php _e( 'Create Gallery', 'gmLang' ); ?></a>
70
  </div>
71
  <div id="gmedia-galleries-wrap">
72
  <ul id="gmedia-galleries-list">
73
  <?php
74
  $taxonomy = 'gmedia_gallery';
75
+ if ( $gmCore->caps['gmedia_edit_others_media'] ) {
76
  $args = array();
77
+ } else {
78
+ $args = array( 'global' => $user_ID );
79
  }
80
 
81
+ $gmediaTerms = $gmDB->get_terms( $taxonomy, $args );
82
 
83
+ if ( count( $gmediaTerms ) ) {
84
+ foreach ( $gmediaTerms as $item ) {
85
+ $module_folder = $gmDB->get_metadata( 'gmedia_term', $item->term_id, 'module', true );
86
+ $module_dir = $gmCore->get_module_path( $module_folder );
87
+ if ( ! $module_dir ) {
88
  continue;
89
  }
90
 
91
  /** @var $module array */
92
  $module_info = array();
93
+ include( $module_dir['path'] . '/index.php' );
94
 
95
  ?>
96
  <li class="gmedia-gallery-li" id="gmGallery-<?php echo $item->term_id; ?>">
99
  </p>
100
 
101
  <p class="gmedia-gallery-source">
102
+ <span class="gmedia-gallery-module"><?php echo __( 'module', 'gmLang' ) . ': ' . $module_info['title']; ?></span>
103
  </p>
104
 
105
  <div class="gmedia-insert">
106
  <div class="gmedia-remove-button">
107
+ <img src="<?php echo $t; ?>" alt=""/><?php _e( 'click to remove shortcode', 'gmLang' ); ?>
108
  <br/>
109
  <small>[gmedia id=<?php echo $item->term_id; ?>]</small>
110
  </div>
111
  <div class="gmedia-insert-button">
112
+ <img src="<?php echo $t; ?>" alt=""/><?php _e( 'click to insert shortcode', 'gmLang' ); ?>
113
  <br/>
114
  <small>[gmedia id=<?php echo $item->term_id; ?>]</small>
115
  </div>
116
  </div>
117
  <div class="gmedia-selector"></div>
118
+ <a href="<?php echo admin_url( "admin.php?page=GrandMedia_Galleries&amp;edit_gallery=" . $item->term_id ); ?>"
119
+ title="Edit Gallery #<?php echo $item->term_id; ?> in New Window" target="_blank" class="gmedia-gallery-gear"><?php _e( 'edit', 'gmLang' ); ?></a>
120
  </li>
121
  <?php
122
  }
123
+ } else {
124
+ echo '<li class="emptydb">' . __( 'No Galleries.', 'gmLang' ) . ' <a target="_blank" href="' . admin_url( 'admin.php?page=GrandMedia_Modules' ) . '">' . __( 'Create', 'gmLang' ) . '</a></li>';
125
  }
126
  ?>
127
  </ul>
128
  </div>
129
  </div>
130
  <div id="gmedia-social">
131
+ <p><a target="_blank" href="http://wordpress.org/extend/plugins/grand-media/"><?php _e( 'Rate Gmedia at Wordpress.org', 'gmLang' ); ?></a></p>
132
  </div>
133
  </div>
134
  </div>
135
  <?php
136
+ }
137
+
138
+ if ( current_user_can( 'gmedia_library' ) ) {
139
+ add_filter( 'admin_post_thumbnail_html', 'gmedia_admin_post_thumbnail_html', 10, 2 );
140
+ }
141
+ /**
142
+ * Filter for the post meta box. look for a NGG image if the ID is "ngg-<imageID>"
143
+ *
144
+ * @param string $content
145
+ * @param int|null $post_id
146
+ *
147
+ * @return string html output
148
+ */
149
+ function gmedia_admin_post_thumbnail_html( $content, $post_id = null ) {
150
+ if ( $post_id == null ) {
151
+ global $post;
152
+
153
+ if ( ! is_object( $post ) ) {
154
+ return $content;
155
+ }
156
+ $post_id = $post->ID;
157
+ }
158
+
159
+ $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set GmediaGallery featured image', 'gmLang' ) . '" href="javascript:void(0)" id="set-gmedia-post-thumbnail">%s</a></p>';
160
+
161
+ $thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );
162
+ if ( $thumbnail_id ) {
163
+ $gmedia_id = get_post_meta( $thumbnail_id, '_gmedia_image_id', true );
164
+ if ( ! empty( $gmedia_id ) ) {
165
+ $content = str_replace( 'attachment-post-thumbnail', 'attachment-post-thumbnail gmedia-post-thumbnail gmedia-image-' . $gmedia_id, $content );
166
+ }
167
+ $content = sprintf( $set_thumbnail_link, esc_html__( 'Replace from Gmedia Library', 'gmLang' ) ) . $content;
168
+ } else {
169
+ $content = sprintf( $set_thumbnail_link, esc_html__( 'Set Gmedia featured image', 'gmLang' ) ) . $content;
170
+ }
171
+
172
+ return $content;
173
+ }
inc/shortcodes.php CHANGED
@@ -1,179 +1,244 @@
1
  <?php
2
- if(preg_match('#' . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
3
- die('You are not allowed to call this page directly.');
4
  }
5
 
6
  /** *********************** **/
7
  /** Shortcodes Declarations **/
8
  /** *********************** **/
9
- add_shortcode('gmedia', 'gmedia_shortcode');
 
10
 
11
  //add_filter('the_content', 'do_shortcode');
12
- add_filter('the_content', 'get_gmedia_unformatted_shortcode_blocks', 4);
13
 
14
  /** ******************************* **/
15
  /** Shortcodes Functions and Markup **/
16
  /** ******************************* **/
17
  $gmedia_shortcode_instance = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  /**
19
  * @param $atts
20
  * @param string $content
21
  *
22
  * @return string
23
  */
24
- function gmedia_shortcode($atts, $content = ''){
25
  global $gmDB, $gmGallery, $gmCore;
26
  global $gmedia_shortcode_instance;
27
  /**
28
  * @var $id
29
  * @var $preview
 
30
  * @var $_tax
31
  * @var $_raw
32
  */
33
- extract(shortcode_atts(array(
34
- 'id' => 0,
35
  'preview' => '',
36
- '_tax' => 'gallery',
37
- '_raw' => false
38
- ), $atts));
39
-
40
- $shortcode_raw = (isset($gmGallery->options['shortcode_raw']) && '1' === $gmGallery->options['shortcode_raw']);
41
- if($shortcode_raw && false !== $_raw){
42
- return $gmedia_shortcode_instance['shortcode_raw'][$_raw];
 
43
  }
44
 
45
- $id = intval($id);
46
- if(!$id){
47
  return $content;
48
  }
49
 
50
  $_gallery = array(
51
- 'term_id' => 0,
52
- 'name' => '',
53
  'description' => '',
54
- 'status' => 'public',
55
- 'edited' => '&#8212;',
56
- 'module' => 'phantom',
57
- 'query' => array(),
58
- 'settings' => array()
59
  );
60
 
61
  $taxonomy = 'gmedia_' . $_tax;
62
- $gallery = $gmDB->get_term($id, $taxonomy, ARRAY_A);
63
- if(is_wp_error($gallery)){
64
  return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . $gallery->get_error_message() . '<br />' . $content . '</div>';
65
- } elseif(empty($gallery)){
66
- return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf(__('No gallery with ID #%s in database'), $id) . '<br />' . $content . '</div>';
67
- } else{
68
- $gallery = array_merge($_gallery, $gallery);
69
- $gallery_meta = $gmDB->get_metadata('gmedia_term', $id);
70
- $gallery_meta = array_map('reset', $gallery_meta);
71
- $gallery_meta = array_map('maybe_unserialize', $gallery_meta);
72
- $gallery = array_merge($gallery, $gallery_meta);
 
 
 
 
 
 
 
 
 
73
  }
74
 
75
- if(!empty($preview) && $gallery['module'] != $preview){
76
- $gallery['module'] = sanitize_key($preview);
77
- $gallery['settings'][$gallery['module']] = array();
78
- } elseif(!isset($gallery['settings'][$gallery['module']])){
79
- $gallery['settings'][$gallery['module']] = array();
80
  }
81
 
82
- if(empty($gallery['query']) && ('gallery' !== $_tax)){
83
- $gallery['query']['gmedia_' . $_tax] = array($id);
84
  }
85
 
86
- $module = $gmCore->get_module_path($gallery['module']);
87
- if(!$module){
88
- return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . __('Gmedia Module folder missed.', 'gmLang') . '<br />' . $content . '</div>';
89
  }
90
 
91
- if(file_exists($module['path'] . '/index.php') && file_exists($module['path'] . '/settings.php')){
92
- $module_info = array('dependencies' => '');
93
- include($module['path'] . '/index.php');
94
  $module['info'] = $module_info;
95
  /** @var $default_options */
96
- include($module['path'] . '/settings.php');
97
- if(isset($default_options)){
98
  $module['options'] = $default_options;
99
- } else{
100
- return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf(__('Module `%s` is outdated. Update module to latest version'), $gallery['module']) . '<br />' . $content . '</div>';
101
  }
102
- } else{
103
- return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf(__('Module `%s` is broken. Choose another module for this gallery'), $gallery['module']) . '<br />' . $content . '</div>';
104
  }
105
 
106
- $settings = $gmCore->array_diff_keyval_recursive($module['options'], $gallery['settings'][$gallery['module']], true);
 
 
 
 
 
 
 
 
107
 
108
- $terms = array();
109
  $gmedia = array();
110
- if(!empty($gallery['query'])){
111
- $gmedia_status = array('public');
112
- if(is_user_logged_in()){
113
- $gmedia_status[] = 'private';
114
- }
115
- foreach($gallery['query'] as $tax => $term_ids){
116
- if(!empty($term_ids)){
117
- if('gmedia__in' == $tax){
118
- $term_id = (int)$gallery['term_id'];
119
- $terms[$term_id] = $gmDB->get_term($term_id, 'gmedia_gallery');
120
- $term_ids = implode(',', wp_parse_id_list($term_ids[0]));
121
- $gmedia[$term_id] = $gmDB->get_gmedias(array('gmedia__in' => $term_ids, 'orderby' => 'gmedia__in', 'order' => 'ASC', 'status' => $gmedia_status));
122
  continue;
123
  }
124
- foreach($term_ids as $term_id){
125
- $terms[$term_id] = $gmDB->get_term($term_id, $tax);
126
- if(!empty($terms[$term_id]) && !is_wp_error($terms[$term_id]) && $terms[$term_id]->count){
127
- if('gmedia_category' == $tax){
128
- $terms[$term_id]->name = $gmGallery->options['taxonomies']['gmedia_category'][$terms[$term_id]->name];
129
- $gmedia[$term_id] = $gmDB->get_gmedias(array('category__in' => $term_id, 'status' => $gmedia_status));
130
- } elseif('gmedia_album' == $tax){
131
- if(('draft' == $terms[$term_id]->status) || (('private' == $terms[$term_id]->status) && !is_user_logged_in())){
132
- unset($terms[$term_id]);
133
- continue;
134
- }
135
- $term_meta = $gmDB->get_metadata('gmedia_term', $term_id);
136
- $term_meta = array_map('reset', $term_meta);
137
- $term_meta = array_merge(array('orderby' => 'ID', 'order' => 'DESC'), $term_meta);
138
- $args = array('album__in' => $term_id, 'orderby' => $term_meta['orderby'], 'order' => $term_meta['order'], 'status' => $gmedia_status);
139
- $gmedia[$term_id] = $gmDB->get_gmedias($args);
140
- } elseif('gmedia_tag' == $tax){
141
- $gmedia[$term_id] = $gmDB->get_gmedias(array('tag__in' => $term_id, 'status' => $gmedia_status));
142
  }
143
- } else{
144
- unset($terms[$term_id]);
145
  }
146
  }
147
- } else{
148
- return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf(__('Choose gallery source, please.'), $gallery['module']) . '<br />' . $content . '</div>';
149
  }
150
  }
151
- } else{
152
- return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf(__('Choose gallery source, please.'), $gallery['module']) . '<br />' . $content . '</div>';
153
  }
154
 
155
- $gmGallery->do_module[$gallery['module']] = $module;
156
 
157
  $out = '<div class="gmedia_gallery ' . $gallery['module'] . '_module" id="GmediaGallery_' . $id . '" data-gallery="' . $id . '" data-module="' . $gallery['module'] . '">';
158
  $out .= $content;
159
 
160
- if(!($is_bot = wp_is_mobile())) {
161
- $is_bot = $gmCore->is_bot();
162
- }
163
 
164
  ob_start();
165
- include($module['path'] . '/init.php');
166
  $out .= ob_get_contents();
167
  ob_end_clean();
168
 
169
- if(isset($settings['customCSS']) && ('' != trim($settings['customCSS']))){
170
  $out .= "<style type='text/css' scoped='scoped'>/**** Custom CSS {$gallery['module']} #{$id} ****/" . $settings['customCSS'] . "</style>";
171
  }
172
 
173
  $out .= '</div>';
174
 
175
- if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
176
- do_action('gmedia_footer_scripts');
177
  }
178
 
179
  return $out;
@@ -196,10 +261,10 @@ function gmedia_shortcode($atts, $content = ''){
196
  *
197
  * @return string Content with shortcode parsed
198
  */
199
- function get_gmedia_unformatted_shortcode_blocks($content){
200
  global $gmGallery;
201
 
202
- if('0' == $gmGallery->options['shortcode_raw']){
203
  return $content;
204
  }
205
 
@@ -210,10 +275,10 @@ function get_gmedia_unformatted_shortcode_blocks($content){
210
  remove_all_shortcodes();
211
 
212
  // my_shortcode_handler1(), below, saves the rawr blocks into $this->unformatted_shortcode_blocks[]
213
- add_shortcode('gmedia', 'gmedia_raw_shortcode');
214
 
215
  // Do the shortcode (only the [rawr] shortcode is now registered)
216
- $content = do_shortcode($content);
217
 
218
  // Put the original shortcodes back for normal processing at priority 11
219
  $shortcode_tags = $orig_shortcode_tags;
@@ -227,30 +292,30 @@ function get_gmedia_unformatted_shortcode_blocks($content){
227
  *
228
  * @return string
229
  */
230
- function gmedia_raw_shortcode($atts, $content = ''){
231
  global $wp_filter, $merged_filters, $wp_current_filter;
232
- $wp_filter_ = $wp_filter;
233
- $merged_filters_ = $merged_filters;
234
  $wp_current_filter_ = $wp_current_filter;
235
- $noraw = do_shortcode(apply_filters('the_content', '[raw][/raw]'));
236
- $wp_filter = $wp_filter_;
237
- $merged_filters = $merged_filters_;
238
- $wp_current_filter = $wp_current_filter_;
239
 
240
  global $gmedia_shortcode_instance;
241
  // Store the unformatted content for later:
242
- $gmedia_shortcode_instance['shortcode_raw'][] = gmedia_shortcode($atts, $content);
243
- $raw_index = count($gmedia_shortcode_instance['shortcode_raw']) - 1;
244
- $shortcode_atts = '';
245
  // Put the shortcode tag back with raw index, so it gets processed again below.
246
  $atts['_raw'] = $raw_index;
247
- foreach($atts as $key => $value){
248
  $shortcode_atts .= " $key=$value";
249
  }
250
- if(!$noraw){
251
  //return "[raw]".gmedia_shortcode($atts, $content)."[/raw]";
252
  return "[raw][gmedia{$shortcode_atts}]{$content}[/gmedia][/raw]";
253
- } else{
254
  return "[gmedia{$shortcode_atts}]{$content}[/gmedia]";
255
  }
256
  }
1
  <?php
2
+ if ( preg_match( '#' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
  /** *********************** **/
7
  /** Shortcodes Declarations **/
8
  /** *********************** **/
9
+ add_shortcode( 'gmedia', 'gmedia_shortcode' );
10
+ add_shortcode( 'gm', 'gmedia_term_shortcode' );
11
 
12
  //add_filter('the_content', 'do_shortcode');
13
+ add_filter( 'the_content', 'get_gmedia_unformatted_shortcode_blocks', 4 );
14
 
15
  /** ******************************* **/
16
  /** Shortcodes Functions and Markup **/
17
  /** ******************************* **/
18
  $gmedia_shortcode_instance = array();
19
+
20
+ /**
21
+ * @param $atts
22
+ * @param string $content
23
+ *
24
+ * @return string
25
+ */
26
+ function gmedia_term_shortcode( $atts, $content = '' ) {
27
+ /**
28
+ * @var $album
29
+ * @var $tag
30
+ * @var $category
31
+ * @var $module
32
+ * @var $preset
33
+ */
34
+ extract( shortcode_atts( array(
35
+ 'album' => 0,
36
+ 'tag' => 0,
37
+ 'category' => 0,
38
+ 'module' => '',
39
+ 'preset' => 0,
40
+ ), $atts ) );
41
+ if ( $album ) {
42
+ $_tax = 'album';
43
+ $id = $album;
44
+ } elseif ( $tag ) {
45
+ $_tax = 'tag';
46
+ $id = $tag;
47
+ } elseif ( $category ) {
48
+ $_tax = 'category';
49
+ $id = $category;
50
+ } else {
51
+ return '';
52
+ }
53
+ $sc_atts = array(
54
+ 'id' => $id,
55
+ 'preview' => $module,
56
+ 'preset' => $preset,
57
+ '_tax' => $_tax
58
+ );
59
+ $out = gmedia_shortcode( $sc_atts, $content );
60
+
61
+ return $out;
62
+ }
63
+
64
  /**
65
  * @param $atts
66
  * @param string $content
67
  *
68
  * @return string
69
  */
70
+ function gmedia_shortcode( $atts, $content = '' ) {
71
  global $gmDB, $gmGallery, $gmCore;
72
  global $gmedia_shortcode_instance;
73
  /**
74
  * @var $id
75
  * @var $preview
76
+ * @var $preset
77
  * @var $_tax
78
  * @var $_raw
79
  */
80
+ extract( shortcode_atts( array(
81
+ 'id' => 0,
82
  'preview' => '',
83
+ 'preset' => 0,
84
+ '_tax' => 'gallery',
85
+ '_raw' => false
86
+ ), $atts ) );
87
+
88
+ $shortcode_raw = ( isset( $gmGallery->options['shortcode_raw'] ) && '1' === $gmGallery->options['shortcode_raw'] );
89
+ if ( $shortcode_raw && false !== $_raw ) {
90
+ return $gmedia_shortcode_instance['shortcode_raw'][ $_raw ];
91
  }
92
 
93
+ $id = intval( $id );
94
+ if ( ! $id ) {
95
  return $content;
96
  }
97
 
98
  $_gallery = array(
99
+ 'term_id' => 0,
100
+ 'name' => '',
101
  'description' => '',
102
+ 'status' => 'public',
103
+ 'edited' => '&#8212;',
104
+ 'module' => 'phantom',
105
+ 'query' => array(),
106
+ 'settings' => array()
107
  );
108
 
109
  $taxonomy = 'gmedia_' . $_tax;
110
+ $gallery = $gmDB->get_term( $id, $taxonomy, ARRAY_A );
111
+ if ( is_wp_error( $gallery ) ) {
112
  return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . $gallery->get_error_message() . '<br />' . $content . '</div>';
113
+ } elseif ( empty( $gallery ) ) {
114
+ return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf( __( 'No gallery with ID #%s in database' ), $id ) . '<br />' . $content . '</div>';
115
+ } else {
116
+ if ( is_user_logged_in() ) {
117
+ if ( ( $gallery['status'] == 'draft' ) && ( $gallery['global'] != get_current_user_id() ) ) {
118
+ return '';
119
+ }
120
+ } else {
121
+ if ( in_array( $gallery['status'], array( 'private', 'draft' ) ) ) {
122
+ return '';
123
+ }
124
+ }
125
+ $gallery = array_merge( $_gallery, $gallery );
126
+ $gallery_meta = $gmDB->get_metadata( 'gmedia_term', $id );
127
+ $gallery_meta = array_map( 'reset', $gallery_meta );
128
+ $gallery_meta = array_map( 'maybe_unserialize', $gallery_meta );
129
+ $gallery = array_merge( $gallery, $gallery_meta );
130
  }
131
 
132
+ if ( ! empty( $preview ) && $gallery['module'] != $preview ) {
133
+ $gallery['module'] = sanitize_key( $preview );
134
+ $gallery['settings'][ $gallery['module'] ] = array();
135
+ } elseif ( ! isset( $gallery['settings'][ $gallery['module'] ] ) ) {
136
+ $gallery['settings'][ $gallery['module'] ] = array();
137
  }
138
 
139
+ if ( empty( $gallery['query'] ) && ( 'gallery' !== $_tax ) ) {
140
+ $gallery['query'][ 'gmedia_' . $_tax ] = array( $id );
141
  }
142
 
143
+ $module = $gmCore->get_module_path( $gallery['module'] );
144
+ if ( ! $module ) {
145
+ return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . __( 'Gmedia Module folder missed.', 'gmLang' ) . '<br />' . $content . '</div>';
146
  }
147
 
148
+ if ( file_exists( $module['path'] . '/index.php' ) && file_exists( $module['path'] . '/settings.php' ) ) {
149
+ $module_info = array( 'dependencies' => '' );
150
+ include( $module['path'] . '/index.php' );
151
  $module['info'] = $module_info;
152
  /** @var $default_options */
153
+ include( $module['path'] . '/settings.php' );
154
+ if ( isset( $default_options ) ) {
155
  $module['options'] = $default_options;
156
+ } else {
157
+ return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf( __( 'Module `%s` is outdated. Update module to latest version' ), $gallery['module'] ) . '<br />' . $content . '</div>';
158
  }
159
+ } else {
160
+ return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf( __( 'Module `%s` is broken. Choose another module for this gallery' ), $gallery['module'] ) . '<br />' . $content . '</div>';
161
  }
162
 
163
+ $settings = $gmCore->array_diff_keyval_recursive( $module['options'], $gallery['settings'][ $gallery['module'] ], true );
164
+
165
+ if ( $preset ) {
166
+ $preset = $gmDB->get_term( $preset, 'gmedia_module' );
167
+ if ( ! empty( $preset ) && ! is_wp_error( $preset ) && ( $gallery['module'] == $preset->status ) ) {
168
+ $presettings = maybe_unserialize( $preset->description );
169
+ $settings = $gmCore->array_diff_keyval_recursive( $settings, $presettings, true );
170
+ }
171
+ }
172
 
173
+ $terms = array();
174
  $gmedia = array();
175
+ if ( ! empty( $gallery['query'] ) ) {
176
+ $gmedia_status = array( 'public' );
177
+ if ( is_user_logged_in() ) {
178
+ $gmedia_status[] = 'private';
179
+ }
180
+ foreach ( $gallery['query'] as $tax => $term_ids ) {
181
+ if ( ! empty( $term_ids ) ) {
182
+ if ( 'gmedia__in' == $tax ) {
183
+ $term_id = (int) $gallery['term_id'];
184
+ $terms[ $term_id ] = $gmDB->get_term( $term_id, 'gmedia_gallery' );
185
+ $term_ids = implode( ',', wp_parse_id_list( $term_ids[0] ) );
186
+ $gmedia[ $term_id ] = $gmDB->get_gmedias( array( 'gmedia__in' => $term_ids, 'orderby' => 'gmedia__in', 'order' => 'ASC', 'status' => $gmedia_status ) );
187
  continue;
188
  }
189
+ foreach ( $term_ids as $term_id ) {
190
+ $terms[ $term_id ] = $gmDB->get_term( $term_id, $tax );
191
+ if ( ! empty( $terms[ $term_id ] ) && ! is_wp_error( $terms[ $term_id ] ) && $terms[ $term_id ]->count ) {
192
+ if ( 'gmedia_category' == $tax ) {
193
+ $terms[ $term_id ]->name = $gmGallery->options['taxonomies']['gmedia_category'][ $terms[ $term_id ]->name ];
194
+ $gmedia[ $term_id ] = $gmDB->get_gmedias( array( 'category__in' => $term_id, 'status' => $gmedia_status ) );
195
+ } elseif ( 'gmedia_album' == $tax ) {
196
+ if ( ( 'draft' == $terms[ $term_id ]->status ) || ( ( 'private' == $terms[ $term_id ]->status ) && ! is_user_logged_in() ) ) {
197
+ unset( $terms[ $term_id ] );
198
+ continue;
199
+ }
200
+ $term_meta = $gmDB->get_metadata( 'gmedia_term', $term_id );
201
+ $term_meta = array_map( 'reset', $term_meta );
202
+ $term_meta = array_merge( array( 'orderby' => 'ID', 'order' => 'DESC' ), $term_meta );
203
+ $args = array( 'album__in' => $term_id, 'orderby' => $term_meta['orderby'], 'order' => $term_meta['order'], 'status' => $gmedia_status );
204
+ $gmedia[ $term_id ] = $gmDB->get_gmedias( $args );
205
+ } elseif ( 'gmedia_tag' == $tax ) {
206
+ $gmedia[ $term_id ] = $gmDB->get_gmedias( array( 'tag__in' => $term_id, 'status' => $gmedia_status ) );
207
  }
208
+ } else {
209
+ unset( $terms[ $term_id ] );
210
  }
211
  }
212
+ } else {
213
+ return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf( __( 'Choose gallery source, please.' ), $gallery['module'] ) . '<br />' . $content . '</div>';
214
  }
215
  }
216
+ } else {
217
+ return '<div class="gmedia_gallery gmediaShortcodeError">#' . $id . ': ' . sprintf( __( 'Choose gallery source, please.' ), $gallery['module'] ) . '<br />' . $content . '</div>';
218
  }
219
 
220
+ $gmGallery->do_module[ $gallery['module'] ] = $module;
221
 
222
  $out = '<div class="gmedia_gallery ' . $gallery['module'] . '_module" id="GmediaGallery_' . $id . '" data-gallery="' . $id . '" data-module="' . $gallery['module'] . '">';
223
  $out .= $content;
224
 
225
+ if ( ! ( $is_bot = wp_is_mobile() ) ) {
226
+ $is_bot = $gmCore->is_bot();
227
+ }
228
 
229
  ob_start();
230
+ include( $module['path'] . '/init.php' );
231
  $out .= ob_get_contents();
232
  ob_end_clean();
233
 
234
+ if ( isset( $settings['customCSS'] ) && ( '' != trim( $settings['customCSS'] ) ) ) {
235
  $out .= "<style type='text/css' scoped='scoped'>/**** Custom CSS {$gallery['module']} #{$id} ****/" . $settings['customCSS'] . "</style>";
236
  }
237
 
238
  $out .= '</div>';
239
 
240
+ if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) {
241
+ do_action( 'gmedia_footer_scripts' );
242
  }
243
 
244
  return $out;
261
  *
262
  * @return string Content with shortcode parsed
263
  */
264
+ function get_gmedia_unformatted_shortcode_blocks( $content ) {
265
  global $gmGallery;
266
 
267
+ if ( '0' == $gmGallery->options['shortcode_raw'] ) {
268
  return $content;
269
  }
270
 
275
  remove_all_shortcodes();
276
 
277
  // my_shortcode_handler1(), below, saves the rawr blocks into $this->unformatted_shortcode_blocks[]
278
+ add_shortcode( 'gmedia', 'gmedia_raw_shortcode' );
279
 
280
  // Do the shortcode (only the [rawr] shortcode is now registered)
281
+ $content = do_shortcode( $content );
282
 
283
  // Put the original shortcodes back for normal processing at priority 11
284
  $shortcode_tags = $orig_shortcode_tags;
292
  *
293
  * @return string
294
  */
295
+ function gmedia_raw_shortcode( $atts, $content = '' ) {
296
  global $wp_filter, $merged_filters, $wp_current_filter;
297
+ $wp_filter_ = $wp_filter;
298
+ $merged_filters_ = $merged_filters;
299
  $wp_current_filter_ = $wp_current_filter;
300
+ $noraw = do_shortcode( apply_filters( 'the_content', '[raw][/raw]' ) );
301
+ $wp_filter = $wp_filter_;
302
+ $merged_filters = $merged_filters_;
303
+ $wp_current_filter = $wp_current_filter_;
304
 
305
  global $gmedia_shortcode_instance;
306
  // Store the unformatted content for later:
307
+ $gmedia_shortcode_instance['shortcode_raw'][] = gmedia_shortcode( $atts, $content );
308
+ $raw_index = count( $gmedia_shortcode_instance['shortcode_raw'] ) - 1;
309
+ $shortcode_atts = '';
310
  // Put the shortcode tag back with raw index, so it gets processed again below.
311
  $atts['_raw'] = $raw_index;
312
+ foreach ( $atts as $key => $value ) {
313
  $shortcode_atts .= " $key=$value";
314
  }
315
+ if ( ! $noraw ) {
316
  //return "[raw]".gmedia_shortcode($atts, $content)."[/raw]";
317
  return "[raw][gmedia{$shortcode_atts}]{$content}[/gmedia][/raw]";
318
+ } else {
319
  return "[gmedia{$shortcode_atts}]{$content}[/gmedia]";
320
  }
321
  }
languages/gmLang-fr_FR.mo ADDED
Binary file
languages/gmLang-fr_FR.po ADDED
@@ -0,0 +1,3194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Gmedia Gallery v1.3.1\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-10-26 22:38:43-0400\n"
7
+ "Last-Translator: cou208gmail-com <cou208@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n>1;\n"
13
+ "X-Generator: CSL v1.x\n"
14
+ "X-Poedit-Language: French\n"
15
+ "X-Poedit-Country: FRANCE\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "X-Poedit-Bookmarks: \n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Textdomain-Support: yes"
22
+
23
+ #: access.php:196
24
+ #: admin/addmedia.php:124
25
+ #: admin/addmedia.php:345
26
+ #: admin/ajax.php:596
27
+ #: admin/ajax.php:614
28
+ #: admin/ajax.php:1114
29
+ #: admin/gmedia.php:391
30
+ #: admin/gmedia.php:507
31
+ #: admin/gmedia.php:657
32
+ #: inc/media-upload.php:712
33
+ #@ gmLang
34
+ #@ default
35
+ msgid "Uncategorized"
36
+ msgstr "Non classé"
37
+
38
+ #: access.php:243
39
+ #: admin/terms.php:232
40
+ #: admin/terms.php:770
41
+ #@ gmLang
42
+ msgid "Shared"
43
+ msgstr "Commun"
44
+
45
+ #: access.php:312
46
+ #: access.php:772
47
+ #: access.php:832
48
+ #@ gmLang
49
+ msgid "You can't do this"
50
+ msgstr "Vous ne pouvez pas le faire"
51
+
52
+ #: access.php:312
53
+ #: access.php:735
54
+ #: access.php:772
55
+ #: access.php:832
56
+ #@ gmLang
57
+ msgid "You have no permission to do this operation"
58
+ msgstr "Vous n'êtes pas autorisé à effectuer cette opération"
59
+
60
+ #: access.php:323
61
+ #: admin/upload.php:60
62
+ #@ gmLang
63
+ msgid "Failed to move uploaded file."
64
+ msgstr "Impossible de déplacer le fichier téléchargé."
65
+
66
+ #: access.php:418
67
+ #: admin/processor.php:389
68
+ #: admin/processor.php:404
69
+ #@ gmLang
70
+ msgid "You are not allowed to edit media"
71
+ msgstr "Vous n'êtes pas autorisé à modifier le média"
72
+
73
+ #: access.php:422
74
+ #: access.php:744
75
+ #: access.php:749
76
+ #: access.php:799
77
+ #: access.php:838
78
+ #: admin/ajax.php:986
79
+ #: admin/galleries.php:386
80
+ #: admin/gmedia.php:311
81
+ #: admin/processor.php:168
82
+ #: admin/processor.php:208
83
+ #: admin/processor.php:264
84
+ #: admin/processor.php:292
85
+ #: admin/processor.php:320
86
+ #: admin/processor.php:532
87
+ #: admin/processor.php:604
88
+ #: admin/processor.php:698
89
+ #@ gmLang
90
+ #@ default
91
+ msgid "You are not allowed to edit others media"
92
+ msgstr "Vous n'êtes pas autorisé à modifier d'autres médias"
93
+
94
+ #: access.php:442
95
+ #@ gmLang
96
+ msgid "You are not allowed to manage categories"
97
+ msgstr "Vous n'êtes pas autorisé à gérer les catégories"
98
+
99
+ #: access.php:454
100
+ #, php-format
101
+ #@ gmLang
102
+ msgid "%d items updated with \"Uncategorized\""
103
+ msgstr "%d items mis à jour avec \"Non classé \""
104
+
105
+ #: access.php:467
106
+ #: admin/processor.php:192
107
+ #, php-format
108
+ #@ gmLang
109
+ msgid "Category `%s` assigned to %d images."
110
+ msgstr "La catégorie `%s` est affectée à %d des images."
111
+
112
+ #: access.php:469
113
+ #: admin/processor.php:194
114
+ #, php-format
115
+ #@ gmLang
116
+ msgid "Category `%s` can't be assigned."
117
+ msgstr "La catégorie `%s` ne peut être affecté."
118
+
119
+ #: access.php:476
120
+ #: admin/processor.php:505
121
+ #@ gmLang
122
+ msgid "You are not allowed to manage albums"
123
+ msgstr "Vous n'êtes pas autorisé à gérer des albums"
124
+
125
+ #: access.php:484
126
+ #: admin/processor.php:219
127
+ #, php-format
128
+ #@ gmLang
129
+ msgid "%d items updated with \"No Album\""
130
+ msgstr "%d item mis à jour avec \"Aucun album \""
131
+
132
+ #: access.php:500
133
+ #: admin/processor.php:249
134
+ #, php-format
135
+ #@ gmLang
136
+ msgid "Album `%s` assigned to %d items"
137
+ msgstr "L'album `%s` est attribuée à %d d'items"
138
+
139
+ #: access.php:506
140
+ #@ gmLang
141
+ msgid "You are not allowed manage tags"
142
+ msgstr "Vous n'êtes pas autorisé gérer les étiquettes"
143
+
144
+ #: access.php:510
145
+ #: access.php:533
146
+ #@ gmLang
147
+ msgid "No tags provided"
148
+ msgstr "Aucune étiquette fournie"
149
+
150
+ #: access.php:524
151
+ #: admin/processor.php:280
152
+ #, php-format
153
+ #@ gmLang
154
+ msgid "%d tags added to %d items"
155
+ msgstr "%d étiquettes ajoutés à %d items"
156
+
157
+ #: access.php:529
158
+ #: admin/processor.php:420
159
+ #: admin/processor.php:476
160
+ #: admin/processor.php:742
161
+ #@ gmLang
162
+ msgid "You are not allowed to delete others media"
163
+ msgstr "Vous n'êtes pas autorisé à supprimer d'autres media"
164
+
165
+ #: access.php:547
166
+ #: admin/processor.php:308
167
+ #, php-format
168
+ #@ gmLang
169
+ msgid "%d tags deleted from %d items"
170
+ msgstr "%d étiquettes supprimées dans %d items"
171
+
172
+ #: access.php:552
173
+ #@ default
174
+ msgid "You are not allowed to delete this post."
175
+ msgstr ""
176
+
177
+ #: access.php:559
178
+ #@ gmLang
179
+ msgid "You are not allowed to delete media others media"
180
+ msgstr "Vous n'êtes pas autorisé à supprimer les médias autres média"
181
+
182
+ #: access.php:563
183
+ #: admin/processor.php:428
184
+ #@ gmLang
185
+ msgid "Error in deleting..."
186
+ msgstr "Erreur en supprimant ..."
187
+
188
+ #: access.php:568
189
+ #: access.php:761
190
+ #: admin/processor.php:489
191
+ #: admin/processor.php:754
192
+ #, php-format
193
+ #@ gmLang
194
+ msgid "%d items deleted successfuly"
195
+ msgstr "%d items supprimés avec succès"
196
+
197
+ #: access.php:779
198
+ #: admin/processor.php:511
199
+ #@ gmLang
200
+ msgid "Term Name is not specified"
201
+ msgstr "Le Nom n'est pas spécifé"
202
+
203
+ #: access.php:783
204
+ #: admin/processor.php:515
205
+ #: admin/processor.php:569
206
+ #@ gmLang
207
+ msgid "Term Name can't be only digits"
208
+ msgstr "Le Nom ne peut pas être uniquement des chiffres"
209
+
210
+ #: access.php:787
211
+ #: access.php:856
212
+ #: admin/ajax.php:1008
213
+ #: admin/processor.php:520
214
+ #: admin/processor.php:627
215
+ #: admin/processor.php:692
216
+ #@ gmLang
217
+ msgid "A term with the id provided do not exists"
218
+ msgstr "Identification (ID) fourni n'existe pas"
219
+
220
+ #: access.php:792
221
+ #: access.php:853
222
+ #: admin/ajax.php:1005
223
+ #: admin/processor.php:116
224
+ #: admin/processor.php:525
225
+ #: admin/processor.php:632
226
+ #@ gmLang
227
+ msgid "A term with the name provided already exists"
228
+ msgstr "Le Nom fourni existe déjà"
229
+
230
+ #: access.php:826
231
+ #: admin/processor.php:556
232
+ #, php-format
233
+ #@ gmLang
234
+ msgid "Album `%s` successfuly saved"
235
+ msgstr "L'album `%s` a été sauvegardé avec succès"
236
+
237
+ #: access.php:850
238
+ #, php-format
239
+ #@ gmLang
240
+ msgid "Tag %d successfuly updated"
241
+ msgstr "L'étiquette %d a été mise à jour avec succès"
242
+
243
+ #: access.php:859
244
+ #: admin/ajax.php:1011
245
+ #@ gmLang
246
+ msgid "Term name can't be only digits or empty"
247
+ msgstr "Le Nom ne peut être des chiffres seulement ou vide"
248
+
249
+ #: access.php:875
250
+ #: admin/processor.php:578
251
+ #, php-format
252
+ #@ gmLang
253
+ msgid "%d of %d tags successfuly added"
254
+ msgstr "%d de %d étiquettes ont été ajoutées avec succès"
255
+
256
+ #: access.php:878
257
+ #: admin/processor.php:581
258
+ #@ gmLang
259
+ msgid "Some of provided tags are already exists"
260
+ msgstr "Certaines des étiquettes fournies existent déjà"
261
+
262
+ #: admin/addmedia.php:21
263
+ #@ gmLang
264
+ msgid "Upload Files"
265
+ msgstr "Télécharger des fichiers"
266
+
267
+ #: admin/addmedia.php:23
268
+ #: admin/addmedia.php:487
269
+ #: admin/addmedia.php:519
270
+ #: admin/addmedia.php:536
271
+ #: admin/ajax.php:1204
272
+ #@ gmLang
273
+ #@ default
274
+ msgid "Import"
275
+ msgstr "Importer"
276
+
277
+ #: admin/addmedia.php:30
278
+ #@ gmLang
279
+ msgid "Add files to the upload queue and click the start button"
280
+ msgstr "Ajouter des fichiers à la file d'attente de téléchargement et cliquez sur le bouton de démarrage"
281
+
282
+ #: admin/addmedia.php:33
283
+ #@ gmLang
284
+ msgid "Grab files from other sources"
285
+ msgstr "Fichiers d'appui provenant d'autres sources"
286
+
287
+ #: admin/addmedia.php:63
288
+ #: inc/media-upload.php:648
289
+ #@ gmLang
290
+ msgid "You do not have permissions to upload media"
291
+ msgstr "Vous n'êtes pas autorisé à télécharger des médias"
292
+
293
+ #: admin/addmedia.php:79
294
+ #: inc/media-upload.php:667
295
+ #@ gmLang
296
+ msgid "Maximum file size"
297
+ msgstr "Dimension maximum du fichier"
298
+
299
+ #: admin/addmedia.php:82
300
+ #: inc/media-upload.php:670
301
+ #@ gmLang
302
+ msgid "Maximum $_POST size"
303
+ msgstr "Dimension maximum $_POST"
304
+
305
+ #: admin/addmedia.php:83
306
+ #: inc/media-upload.php:671
307
+ #@ gmLang
308
+ msgid "Chunk size"
309
+ msgstr "Taille des fragments"
310
+
311
+ #: admin/addmedia.php:88
312
+ #: admin/admin.php:389
313
+ #: admin/admin.php:426
314
+ #: admin/ajax.php:890
315
+ #: admin/gmedia.php:604
316
+ #: admin/gmedia.php:605
317
+ #: admin/wpmedia.php:195
318
+ #: inc/media-upload.php:508
319
+ #: inc/media-upload.php:509
320
+ #: inc/media-upload.php:676
321
+ #@ gmLang
322
+ msgid "Title"
323
+ msgstr "Titre"
324
+
325
+ #: admin/addmedia.php:90
326
+ #: inc/media-upload.php:678
327
+ #@ gmLang
328
+ msgid "EXIF or File Name"
329
+ msgstr "EXIF ou nom du fichier"
330
+
331
+ #: admin/addmedia.php:91
332
+ #: inc/media-upload.php:679
333
+ #@ gmLang
334
+ msgid "File Name"
335
+ msgstr "Nom du fichier"
336
+
337
+ #: admin/addmedia.php:92
338
+ #: inc/media-upload.php:680
339
+ #@ gmLang
340
+ msgid "Empty"
341
+ msgstr "Aucun"
342
+
343
+ #: admin/addmedia.php:96
344
+ #: admin/ajax.php:919
345
+ #: admin/galleries.php:216
346
+ #: admin/galleries.php:548
347
+ #: admin/gmedia.php:412
348
+ #: admin/gmedia.php:528
349
+ #: admin/gmedia.php:740
350
+ #: admin/terms.php:210
351
+ #: admin/terms.php:741
352
+ #: inc/media-upload.php:316
353
+ #: inc/media-upload.php:684
354
+ #@ gmLang
355
+ msgid "Status"
356
+ msgstr "Statut"
357
+
358
+ #: admin/addmedia.php:98
359
+ #: inc/media-upload.php:686
360
+ #@ gmLang
361
+ msgid "Same as Album or Public"
362
+ msgstr "Même qu'Album ou Public"
363
+
364
+ #: admin/addmedia.php:99
365
+ #: admin/ajax.php:922
366
+ #: admin/galleries.php:550
367
+ #: admin/gmedia.php:742
368
+ #: admin/terms.php:212
369
+ #: admin/terms.php:744
370
+ #: inc/media-upload.php:687
371
+ #@ gmLang
372
+ msgid "Public"
373
+ msgstr "Public"
374
+
375
+ #: admin/addmedia.php:100
376
+ #: admin/ajax.php:923
377
+ #: admin/galleries.php:551
378
+ #: admin/gmedia.php:743
379
+ #: admin/terms.php:213
380
+ #: admin/terms.php:746
381
+ #: inc/media-upload.php:688
382
+ #@ gmLang
383
+ msgid "Private"
384
+ msgstr "Privé"
385
+
386
+ #: admin/addmedia.php:101
387
+ #: admin/ajax.php:924
388
+ #: admin/galleries.php:552
389
+ #: admin/gmedia.php:744
390
+ #: admin/terms.php:214
391
+ #: admin/terms.php:748
392
+ #: inc/media-upload.php:689
393
+ #@ gmLang
394
+ msgid "Draft"
395
+ msgstr "Brouillon"
396
+
397
+ #: admin/addmedia.php:120
398
+ #: admin/addmedia.php:341
399
+ #: admin/ajax.php:462
400
+ #: admin/ajax.php:1110
401
+ #: inc/media-upload.php:708
402
+ #@ gmLang
403
+ msgid "Assign Category"
404
+ msgstr "Assigné une catégorie"
405
+
406
+ #: admin/addmedia.php:121
407
+ #: admin/addmedia.php:342
408
+ #: admin/ajax.php:1111
409
+ #: inc/media-upload.php:709
410
+ #@ default
411
+ msgid "(for images only)"
412
+ msgstr ""
413
+
414
+ #: admin/addmedia.php:136
415
+ #: admin/addmedia.php:357
416
+ #: admin/ajax.php:1127
417
+ #: inc/media-upload.php:724
418
+ #@ gmLang
419
+ msgid " (shared)"
420
+ msgstr "(partagé)"
421
+
422
+ #: admin/addmedia.php:140
423
+ #: admin/addmedia.php:361
424
+ #: admin/ajax.php:1131
425
+ #: inc/media-upload.php:728
426
+ #@ gmLang
427
+ msgid "Add to Album"
428
+ msgstr "Ajouter à l'album"
429
+
430
+ #: admin/addmedia.php:141
431
+ #: admin/addmedia.php:362
432
+ #: admin/ajax.php:692
433
+ #: admin/ajax.php:1132
434
+ #: admin/gmedia.php:699
435
+ #: inc/media-upload.php:729
436
+ #@ gmLang
437
+ msgid "Album Name..."
438
+ msgstr "Nom de l'album"
439
+
440
+ #: admin/addmedia.php:151
441
+ #: admin/addmedia.php:372
442
+ #: admin/ajax.php:484
443
+ #: admin/ajax.php:1143
444
+ #: inc/media-upload.php:739
445
+ #@ gmLang
446
+ msgid "Add Tags"
447
+ msgstr "Ajouter des étiquettes"
448
+
449
+ #: admin/addmedia.php:152
450
+ #: admin/addmedia.php:373
451
+ #: admin/ajax.php:791
452
+ #: admin/ajax.php:1144
453
+ #: admin/gmedia.php:240
454
+ #: inc/media-upload.php:740
455
+ #@ gmLang
456
+ msgid "Add Tags..."
457
+ msgstr "Ajouter des étiquettes"
458
+
459
+ #: admin/addmedia.php:155
460
+ #: admin/addmedia.php:376
461
+ #: admin/ajax.php:1147
462
+ #: admin/processor.php:199
463
+ #: admin/processor.php:255
464
+ #: admin/processor.php:283
465
+ #: admin/processor.php:311
466
+ #: inc/media-upload.php:743
467
+ #@ gmLang
468
+ msgid "You are not allowed to assign terms"
469
+ msgstr "Vous n'êtes pas autorisé à assigner des termes"
470
+
471
+ #: admin/addmedia.php:208
472
+ #: inc/media-upload.php:796
473
+ #@ gmLang
474
+ msgid "You browser doesn't have Flash or HTML5 support. Check also if page have no JavaScript errors."
475
+ msgstr "Votre navigateur ne dispose pas de Flash ou du support HTML5. Vérifiez également si la page ne ​​présente pas une erreur JavaScript."
476
+
477
+ #: admin/addmedia.php:315
478
+ #@ gmLang
479
+ msgid "You do not have permissions to import media"
480
+ msgstr "Vous n'êtes pas autorisé à importer des médias"
481
+
482
+ #: admin/addmedia.php:422
483
+ #: admin/import.php:348
484
+ #@ gmLang
485
+ #@ default
486
+ msgid "Import Server Folder"
487
+ msgstr "Importer un répertoire du serveur"
488
+
489
+ #: admin/addmedia.php:424
490
+ #@ gmLang
491
+ msgid "FlAGallery plugin"
492
+ msgstr ""
493
+
494
+ #: admin/addmedia.php:429
495
+ #@ gmLang
496
+ msgid "NextGen plugin"
497
+ msgstr ""
498
+
499
+ #: admin/addmedia.php:439
500
+ #@ default
501
+ msgid "Sever folders"
502
+ msgstr ""
503
+
504
+ #: admin/addmedia.php:444
505
+ #@ default
506
+ msgid "delete source files after importing"
507
+ msgstr ""
508
+
509
+ #: admin/addmedia.php:446
510
+ #@ gmLang
511
+ msgid "Import folder"
512
+ msgstr "Importer un répertoire"
513
+
514
+ #: admin/addmedia.php:454
515
+ #@ gmLang
516
+ msgid "loading..."
517
+ msgstr "Chargement ...."
518
+
519
+ #: admin/addmedia.php:470
520
+ #: admin/addmedia.php:502
521
+ #@ default
522
+ msgid "If Album is not specified, then gallery name will be used as Album"
523
+ msgstr ""
524
+
525
+ #: admin/addmedia.php:471
526
+ #: admin/addmedia.php:503
527
+ #@ default
528
+ msgid "Flagallery Galleries"
529
+ msgstr ""
530
+
531
+ #: admin/addmedia.php:472
532
+ #: admin/addmedia.php:504
533
+ #@ gmLang
534
+ msgid "Toggle checkboxes"
535
+ msgstr "Cases à cocher basculantes"
536
+
537
+ #: admin/addmedia.php:490
538
+ #: admin/addmedia.php:522
539
+ #@ gmLang
540
+ msgid "There are no created galleries in this plugin."
541
+ msgstr "Il n'y a pas de galeries créées dans ce plugin."
542
+
543
+ #: admin/addmedia.php:549
544
+ #: admin/ajax.php:1204
545
+ #: admin/gmedia.php:310
546
+ #: admin/terms.php:257
547
+ #: admin/terms.php:389
548
+ #@ gmLang
549
+ msgid "Close"
550
+ msgstr "Fermer"
551
+
552
+ #: admin/addmedia.php:549
553
+ #: admin/ajax.php:1204
554
+ #@ gmLang
555
+ msgid "Working..."
556
+ msgstr "En exécution ...."
557
+
558
+ #: admin/admin.php:80
559
+ #: admin/admin.php:81
560
+ #: admin/settings.php:63
561
+ #: inc/media-upload.php:35
562
+ #: inc/media-upload.php:60
563
+ #@ gmLang
564
+ msgid "Gmedia Library"
565
+ msgstr "Bibliothèque Gmedia"
566
+
567
+ #: admin/admin.php:83
568
+ #@ gmLang
569
+ msgid "Add Media Files"
570
+ msgstr "Ajouter des fichiers multimédias"
571
+
572
+ #: admin/admin.php:83
573
+ #@ gmLang
574
+ msgid "Add/Import Files"
575
+ msgstr "Ajouter/Importer des fichiers"
576
+
577
+ #: admin/admin.php:84
578
+ #: admin/settings.php:121
579
+ #@ gmLang
580
+ msgid "Albums, Tags..."
581
+ msgstr "Albums, Étiquettes..."
582
+
583
+ #: admin/admin.php:85
584
+ #: inc/media-upload.php:32
585
+ #: inc/media-upload.php:34
586
+ #: inc/media-upload.php:61
587
+ #: inc/post-metabox.php:69
588
+ #@ gmLang
589
+ msgid "Gmedia Galleries"
590
+ msgstr "Galeries Gmedia"
591
+
592
+ #: admin/admin.php:85
593
+ #@ gmLang
594
+ msgid "Create/Manage Galleries..."
595
+ msgstr "Créer/Gérer des galeries..."
596
+
597
+ #: admin/admin.php:86
598
+ #: admin/settings.php:155
599
+ #@ gmLang
600
+ msgid "Modules"
601
+ msgstr ""
602
+
603
+ #: admin/admin.php:87
604
+ #@ gmLang
605
+ msgid "Gmedia Settings"
606
+ msgstr "Paramètres Gmedia"
607
+
608
+ #: admin/admin.php:87
609
+ #: admin/admin.php:371
610
+ #: admin/settings.php:162
611
+ #@ gmLang
612
+ msgid "Settings"
613
+ msgstr "Paramètres"
614
+
615
+ #: admin/admin.php:88
616
+ #@ gmLang
617
+ msgid "Wordpress Media Library"
618
+ msgstr "Bibliothèque Wordpress Media"
619
+
620
+ #: admin/admin.php:88
621
+ #@ gmLang
622
+ msgid "WP Media Library"
623
+ msgstr "Bibliothèque WP Media"
624
+
625
+ #: admin/admin.php:117
626
+ #@ gmLang
627
+ msgid "Updating GmediaGallery Plugin"
628
+ msgstr "Mettre à jour le plugin GmediaGallery"
629
+
630
+ #: admin/admin.php:341
631
+ #@ default
632
+ msgid "Support"
633
+ msgstr ""
634
+
635
+ #: admin/admin.php:349
636
+ #@ gmLang
637
+ msgid "Support Forum"
638
+ msgstr "Forum de support"
639
+
640
+ #: admin/admin.php:350
641
+ #@ gmLang
642
+ msgid "Contact"
643
+ msgstr "Contact"
644
+
645
+ #: admin/admin.php:351
646
+ #@ gmLang
647
+ msgid "Demo"
648
+ msgstr "Démo"
649
+
650
+ #: admin/admin.php:352
651
+ #@ gmLang
652
+ msgid "Premium"
653
+ msgstr ""
654
+
655
+ #: admin/admin.php:373
656
+ #@ gmLang
657
+ msgid "Apply"
658
+ msgstr "Appliquer"
659
+
660
+ #: admin/admin.php:384
661
+ #: admin/admin.php:421
662
+ #@ gmLang
663
+ msgid "items per page"
664
+ msgstr "Items par page"
665
+
666
+ #: admin/admin.php:388
667
+ #: admin/admin.php:425
668
+ #: admin/gmedia.php:770
669
+ #: admin/terms.php:691
670
+ #: admin/wpmedia.php:183
671
+ #@ gmLang
672
+ msgid "ID"
673
+ msgstr ""
674
+
675
+ #: admin/admin.php:390
676
+ #: admin/admin.php:427
677
+ #: admin/gmedia.php:431
678
+ #: admin/gmedia.php:547
679
+ #: admin/gmedia.php:731
680
+ #@ gmLang
681
+ msgid "Date"
682
+ msgstr ""
683
+
684
+ #: admin/admin.php:391
685
+ #: admin/admin.php:428
686
+ #@ gmLang
687
+ msgid "Last Modified"
688
+ msgstr "Dernière mise à jour"
689
+
690
+ #: admin/admin.php:392
691
+ #: admin/admin.php:429
692
+ #@ gmLang
693
+ msgid "MIME Type"
694
+ msgstr "Type MINE"
695
+
696
+ #: admin/admin.php:393
697
+ #: admin/admin.php:430
698
+ #: admin/ajax.php:934
699
+ #: admin/galleries.php:200
700
+ #: admin/gmedia.php:428
701
+ #: admin/gmedia.php:544
702
+ #: admin/gmedia.php:750
703
+ #: admin/terms.php:219
704
+ #: admin/terms.php:757
705
+ #: inc/media-upload.php:301
706
+ #@ gmLang
707
+ msgid "Author"
708
+ msgstr "Auteur"
709
+
710
+ #: admin/admin.php:394
711
+ #: admin/admin.php:431
712
+ #@ gmLang
713
+ msgid "order items"
714
+ msgstr "Tri des items"
715
+
716
+ #: admin/admin.php:398
717
+ #: admin/admin.php:435
718
+ #: admin/terms.php:204
719
+ #: admin/terms.php:734
720
+ #@ gmLang
721
+ msgid "DESC"
722
+ msgstr ""
723
+
724
+ #: admin/admin.php:399
725
+ #: admin/admin.php:436
726
+ #: admin/terms.php:203
727
+ #: admin/terms.php:732
728
+ #@ gmLang
729
+ msgid "ASC"
730
+ msgstr ""
731
+
732
+ #: admin/admin.php:400
733
+ #: admin/admin.php:437
734
+ #@ gmLang
735
+ msgid "sort order"
736
+ msgstr "ordre de tri"
737
+
738
+ #: admin/admin.php:407
739
+ #: admin/admin.php:459
740
+ #: admin/admin.php:465
741
+ #@ gmLang
742
+ msgid "FALSE"
743
+ msgstr "FAUX"
744
+
745
+ #: admin/admin.php:408
746
+ #: admin/admin.php:458
747
+ #: admin/admin.php:464
748
+ #@ gmLang
749
+ msgid "TRUE"
750
+ msgstr "VRAI"
751
+
752
+ #: admin/admin.php:409
753
+ #@ gmLang
754
+ msgid "Quick Tags panel for Description field"
755
+ msgstr "Mots clés pour le champs Description"
756
+
757
+ #: admin/admin.php:418
758
+ #@ gmLang
759
+ msgid "Set query options for this page to be loaded by default."
760
+ msgstr "Définir les options de requête pour cette page soit chargée par défaut."
761
+
762
+ #: admin/admin.php:448
763
+ #@ gmLang
764
+ msgid "Uploader runtime:"
765
+ msgstr "Temps de téléchargement:"
766
+
767
+ #: admin/admin.php:450
768
+ #@ gmLang
769
+ msgid "Auto"
770
+ msgstr ""
771
+
772
+ #: admin/admin.php:451
773
+ #@ gmLang
774
+ msgid "HTML5 Uploader"
775
+ msgstr "Téléchargement HTML5"
776
+
777
+ #: admin/admin.php:452
778
+ #@ gmLang
779
+ msgid "Flash Uploader"
780
+ msgstr "Téléchargement Flash"
781
+
782
+ #: admin/admin.php:453
783
+ #@ gmLang
784
+ msgid "HTML4 Uploader"
785
+ msgstr "Téléchargement HTML4"
786
+
787
+ #: admin/admin.php:456
788
+ #@ gmLang
789
+ msgid "Chunking:"
790
+ msgstr "Compression:"
791
+
792
+ #: admin/admin.php:462
793
+ #@ gmLang
794
+ msgid "URL streem upload:"
795
+ msgstr "Chargement URL streem:"
796
+
797
+ #: admin/ajax.php:275
798
+ #, php-format
799
+ #@ gmLang
800
+ msgid "Image \"%d\" updated"
801
+ msgstr "Image \"%d\" mise à jour"
802
+
803
+ #: admin/ajax.php:421
804
+ #, php-format
805
+ #@ gmLang
806
+ msgid "Image \"%d\" restored from backup and saved"
807
+ msgstr "Image \"%d\" restorée de la copie de sauvegarde et sauvegardée"
808
+
809
+ #: admin/ajax.php:450
810
+ #@ gmLang
811
+ msgid "Quick Gallery from selected items"
812
+ msgstr "Galerie intantannée pour les items sélectionnés"
813
+
814
+ #: admin/ajax.php:451
815
+ #@ gmLang
816
+ msgid "Create Quick Gallery"
817
+ msgstr "Création d'une galerie instantanée"
818
+
819
+ #: admin/ajax.php:454
820
+ #@ gmLang
821
+ msgid "Show Images from Categories"
822
+ msgstr "Afficher les images des catégories"
823
+
824
+ #: admin/ajax.php:455
825
+ #: admin/ajax.php:466
826
+ #: admin/ajax.php:477
827
+ #: admin/ajax.php:497
828
+ #@ gmLang
829
+ msgid "Show Selected"
830
+ msgstr "Affichage sélectionnée"
831
+
832
+ #: admin/ajax.php:461
833
+ #@ gmLang
834
+ msgid "Assign Category for Selected Images"
835
+ msgstr "Attribuer une catégorie aux images sélectionnées"
836
+
837
+ #: admin/ajax.php:465
838
+ #@ gmLang
839
+ msgid "Filter Albums"
840
+ msgstr "Filtrer par Album"
841
+
842
+ #: admin/ajax.php:472
843
+ #@ gmLang
844
+ msgid "Assign Album for Selected Items"
845
+ msgstr "Attribuer un album aux items sélectionnés"
846
+
847
+ #: admin/ajax.php:473
848
+ #@ gmLang
849
+ msgid "Assign Album"
850
+ msgstr "Attribuer un album"
851
+
852
+ #: admin/ajax.php:476
853
+ #@ gmLang
854
+ msgid "Filter by Tags"
855
+ msgstr "Filter par étiquettes"
856
+
857
+ #: admin/ajax.php:483
858
+ #@ gmLang
859
+ msgid "Add Tags to Selected Items"
860
+ msgstr "Ajouter des étiquettes aux items sélectionnés"
861
+
862
+ #: admin/ajax.php:491
863
+ #@ gmLang
864
+ msgid "Delete Tags from Selected Items"
865
+ msgstr "Supprimer des étiquettes pour la sélection d'items"
866
+
867
+ #: admin/ajax.php:492
868
+ #@ gmLang
869
+ msgid "Delete Tags"
870
+ msgstr "Supprimer les étiquettes"
871
+
872
+ #: admin/ajax.php:495
873
+ #@ gmLang
874
+ msgid "Filter by Author"
875
+ msgstr "Filtrer par auteur"
876
+
877
+ #: admin/ajax.php:506
878
+ #: admin/gmedia.php:215
879
+ #@ gmLang
880
+ msgid "Batch Edit"
881
+ msgstr "Éditier par lot"
882
+
883
+ #: admin/ajax.php:507
884
+ #@ gmLang
885
+ msgid "Batch Save"
886
+ msgstr "Lot sauvegardé"
887
+
888
+ #: admin/ajax.php:528
889
+ #@ gmLang
890
+ msgid "No selected Gmedia. Select at least one item in library."
891
+ msgstr "Aucune sélection dans Gmedia. Sélectionnez au moins un article dans la bibliothèque."
892
+
893
+ #: admin/ajax.php:556
894
+ #: admin/ajax.php:557
895
+ #: admin/galleries.php:544
896
+ #: admin/galleries.php:545
897
+ #@ gmLang
898
+ msgid "Gallery Name"
899
+ msgstr "Nom de la galerie"
900
+
901
+ #: admin/ajax.php:560
902
+ #@ gmLang
903
+ msgid "Modue"
904
+ msgstr "Module"
905
+
906
+ #: admin/ajax.php:588
907
+ #@ gmLang
908
+ msgid "Selected IDs"
909
+ msgstr "IDs sélectionnés"
910
+
911
+ #: admin/ajax.php:632
912
+ #: admin/ajax.php:694
913
+ #@ gmLang
914
+ msgid "No Album"
915
+ msgstr "Numéro d'album"
916
+
917
+ #: admin/ajax.php:639
918
+ #: admin/ajax.php:678
919
+ #: admin/gmedia.php:679
920
+ #: admin/terms.php:276
921
+ #, php-format
922
+ #@ gmLang
923
+ msgid "by %s"
924
+ msgstr "par %s"
925
+
926
+ #: admin/ajax.php:642
927
+ #: admin/ajax.php:681
928
+ #: admin/gmedia.php:682
929
+ #: admin/terms.php:285
930
+ #@ gmLang
931
+ msgid "shared"
932
+ msgstr "Commun"
933
+
934
+ #: admin/ajax.php:691
935
+ #@ gmLang
936
+ msgid "Move to Album"
937
+ msgstr "Déplacez à l'album"
938
+
939
+ #: admin/ajax.php:699
940
+ #@ gmLang
941
+ msgid "Make status of selected items be the same as Album status"
942
+ msgstr "Assurez-vous que le statut des items sélectionnés soit le même que le statut de l'album"
943
+
944
+ #: admin/ajax.php:750
945
+ #@ gmLang
946
+ msgid "Filter Tags..."
947
+ msgstr "Filtrer par étiquette"
948
+
949
+ #: admin/ajax.php:781
950
+ #: admin/ajax.php:832
951
+ #: admin/ajax.php:852
952
+ #@ gmLang
953
+ msgid "No tags"
954
+ msgstr "Aucune étiquette"
955
+
956
+ #: admin/ajax.php:860
957
+ #@ gmLang
958
+ msgid "Choose Author"
959
+ msgstr "Choisissez un auteur"
960
+
961
+ #: admin/ajax.php:882
962
+ #@ default
963
+ msgid "You are not allowed to see others media"
964
+ msgstr ""
965
+
966
+ #: admin/ajax.php:888
967
+ #@ default
968
+ msgid "Note, data will be saved to all selected items in Gmedia Library."
969
+ msgstr ""
970
+
971
+ #: admin/ajax.php:892
972
+ #: admin/ajax.php:902
973
+ #: admin/ajax.php:911
974
+ #: admin/ajax.php:921
975
+ #: admin/ajax.php:936
976
+ #@ gmLang
977
+ msgid "Skip. Do not change"
978
+ msgstr "Passer, pas de changement"
979
+
980
+ #: admin/ajax.php:893
981
+ #@ gmLang
982
+ msgid "Empty Title"
983
+ msgstr "Aucun titre"
984
+
985
+ #: admin/ajax.php:894
986
+ #@ gmLang
987
+ msgid "From Filename"
988
+ msgstr "Du nom de fichier"
989
+
990
+ #: admin/ajax.php:895
991
+ #: admin/ajax.php:904
992
+ #: admin/ajax.php:914
993
+ #@ gmLang
994
+ msgid "Custom"
995
+ msgstr "Personnalisé"
996
+
997
+ #: admin/ajax.php:897
998
+ #@ default
999
+ msgid "Enter custom title here"
1000
+ msgstr ""
1001
+
1002
+ #: admin/ajax.php:900
1003
+ #: admin/galleries.php:647
1004
+ #: admin/gmedia.php:614
1005
+ #: admin/terms.php:182
1006
+ #: admin/terms.php:704
1007
+ #: admin/wpmedia.php:197
1008
+ #: inc/media-upload.php:523
1009
+ #@ gmLang
1010
+ msgid "Description"
1011
+ msgstr ""
1012
+
1013
+ #: admin/ajax.php:903
1014
+ #@ gmLang
1015
+ msgid "Empty Description"
1016
+ msgstr "Aucune description"
1017
+
1018
+ #: admin/ajax.php:906
1019
+ #@ default
1020
+ msgid "Enter description here"
1021
+ msgstr ""
1022
+
1023
+ #: admin/ajax.php:909
1024
+ #: admin/gmedia.php:434
1025
+ #: admin/gmedia.php:550
1026
+ #@ gmLang
1027
+ msgid "Link"
1028
+ msgstr "Lié"
1029
+
1030
+ #: admin/ajax.php:912
1031
+ #@ gmLang
1032
+ msgid "Empty Link"
1033
+ msgstr "Aucun lien"
1034
+
1035
+ #: admin/ajax.php:913
1036
+ #@ gmLang
1037
+ msgid "Link to original file"
1038
+ msgstr "Lien au fichier original"
1039
+
1040
+ #: admin/ajax.php:916
1041
+ #@ default
1042
+ msgid "Enter url here"
1043
+ msgstr ""
1044
+
1045
+ #: admin/ajax.php:960
1046
+ #@ gmLang
1047
+ msgid "Ops! Something wrong."
1048
+ msgstr "Ops! Quelque chose ne va."
1049
+
1050
+ #: admin/ajax.php:966
1051
+ #: admin/ajax.php:1203
1052
+ #: admin/galleries.php:324
1053
+ #: admin/galleries.php:923
1054
+ #: admin/modules.php:193
1055
+ #@ gmLang
1056
+ msgid "Cancel"
1057
+ msgstr "Annuler"
1058
+
1059
+ #: admin/ajax.php:1002
1060
+ #, php-format
1061
+ #@ gmLang
1062
+ msgid "Tag #%d successfuly updated"
1063
+ msgstr "L'étiquette #%d a été mise à jour avec succès "
1064
+
1065
+ #: admin/ajax.php:1027
1066
+ #@ default
1067
+ msgid "You are not allowed to install modules"
1068
+ msgstr ""
1069
+
1070
+ #: admin/ajax.php:1049
1071
+ #: admin/processor.php:787
1072
+ #@ flag
1073
+ msgid "Could not access filesystem."
1074
+ msgstr ""
1075
+
1076
+ #: admin/ajax.php:1051
1077
+ #: admin/processor.php:789
1078
+ #@ flag
1079
+ msgid "Filesystem error"
1080
+ msgstr ""
1081
+
1082
+ #: admin/ajax.php:1063
1083
+ #, php-format
1084
+ #@ flag
1085
+ msgid "The `%s` module successfuly installed"
1086
+ msgstr ""
1087
+
1088
+ #: admin/ajax.php:1066
1089
+ #: admin/processor.php:802
1090
+ #@ gmLang
1091
+ msgid "No file specified"
1092
+ msgstr "Aucun fichier n'a été spécifié"
1093
+
1094
+ #: admin/ajax.php:1087
1095
+ #: admin/import.php:468
1096
+ #@ default
1097
+ msgid "Import from WP Media Library"
1098
+ msgstr ""
1099
+
1100
+ #: admin/ajax.php:1264
1101
+ #@ gmLang
1102
+ msgid "No items related by tags."
1103
+ msgstr "Aucun item n'est relié par des étiquettes"
1104
+
1105
+ #: admin/ajax.php:1298
1106
+ #@ gmLang
1107
+ msgid "No items matching the search query."
1108
+ msgstr "Aucun item ne correspond à votre requête de recherche"
1109
+
1110
+ #: admin/ajax.php:1300
1111
+ #@ gmLang
1112
+ msgid "No items to show"
1113
+ msgstr "Aucun item à afficher"
1114
+
1115
+ #: admin/galleries.php:83
1116
+ #: admin/gmedia.php:90
1117
+ #: admin/terms.php:80
1118
+ #: admin/wpmedia.php:50
1119
+ #: inc/media-upload.php:243
1120
+ #: inc/media-upload.php:467
1121
+ #@ gmLang
1122
+ msgid "Search..."
1123
+ msgstr "Recherche..."
1124
+
1125
+ #: admin/galleries.php:94
1126
+ #: admin/galleries.php:112
1127
+ #: admin/galleries.php:130
1128
+ #: admin/gmedia.php:101
1129
+ #: admin/gmedia.php:124
1130
+ #: admin/gmedia.php:200
1131
+ #: admin/gmedia.php:280
1132
+ #: admin/terms.php:96
1133
+ #: admin/terms.php:123
1134
+ #: admin/terms.php:153
1135
+ #: admin/terms.php:664
1136
+ #: admin/wpmedia.php:63
1137
+ #: admin/wpmedia.php:88
1138
+ #: admin/wpmedia.php:136
1139
+ #: admin/wpmedia.php:158
1140
+ #@ gmLang
1141
+ msgid "Toggle Dropdown"
1142
+ msgstr "Bascule déroulante"
1143
+
1144
+ #: admin/galleries.php:97
1145
+ #: admin/gmedia.php:103
1146
+ #: admin/gmedia.php:138
1147
+ #: admin/terms.php:99
1148
+ #: admin/wpmedia.php:65
1149
+ #: admin/wpmedia.php:95
1150
+ #@ gmLang
1151
+ msgid "All"
1152
+ msgstr "Tout"
1153
+
1154
+ #: admin/galleries.php:98
1155
+ #: admin/gmedia.php:104
1156
+ #: admin/terms.php:100
1157
+ #: admin/wpmedia.php:66
1158
+ #: inc/media-upload.php:542
1159
+ #@ gmLang
1160
+ msgid "None"
1161
+ msgstr "Aucun"
1162
+
1163
+ #: admin/galleries.php:100
1164
+ #: admin/gmedia.php:110
1165
+ #: admin/terms.php:103
1166
+ #: admin/wpmedia.php:73
1167
+ #@ gmLang
1168
+ msgid "Reverse only visible items"
1169
+ msgstr "Inverser seulement des articles visibles"
1170
+
1171
+ #: admin/galleries.php:100
1172
+ #: admin/gmedia.php:110
1173
+ #: admin/terms.php:103
1174
+ #: admin/wpmedia.php:73
1175
+ #@ gmLang
1176
+ msgid "Reverse"
1177
+ msgstr "Inverser"
1178
+
1179
+ #: admin/galleries.php:105
1180
+ #: admin/modules.php:125
1181
+ #: inc/media-upload.php:250
1182
+ #: inc/post-metabox.php:69
1183
+ #@ gmLang
1184
+ msgid "Create Gallery"
1185
+ msgstr "Créer une Galerie"
1186
+
1187
+ #: admin/galleries.php:109
1188
+ #: admin/gmedia.php:195
1189
+ #: admin/gmedia.php:197
1190
+ #: admin/terms.php:120
1191
+ #: admin/terms.php:661
1192
+ #: admin/wpmedia.php:133
1193
+ #@ gmLang
1194
+ msgid "Action"
1195
+ msgstr ""
1196
+
1197
+ #: admin/galleries.php:119
1198
+ #: admin/gmedia.php:263
1199
+ #: admin/terms.php:131
1200
+ #: admin/wpmedia.php:149
1201
+ #@ gmLang
1202
+ msgid "Select items to see more actions"
1203
+ msgstr "Sélectionner des items pour voir plus d'Actions"
1204
+
1205
+ #: admin/galleries.php:121
1206
+ #: admin/gmedia.php:252
1207
+ #: admin/terms.php:138
1208
+ #@ gmLang
1209
+ msgid ""
1210
+ "You are about to permanently delete the selected items.\n"
1211
+ "\\r'Cancel' to stop, 'OK' to delete."
1212
+ msgstr ""
1213
+ "Vous êtes sur le point de supprimer définitivement les items sélectionnés.\n"
1214
+ "\\r'Annuler 'pour arrêter, 'Continuer' pour supprimer."
1215
+
1216
+ #: admin/galleries.php:121
1217
+ #: admin/gmedia.php:252
1218
+ #: admin/terms.php:138
1219
+ #@ gmLang
1220
+ msgid "Delete Selected Items"
1221
+ msgstr "Supprimer les items sélectionnés"
1222
+
1223
+ #: admin/galleries.php:128
1224
+ #: admin/gmedia.php:278
1225
+ #: admin/terms.php:150
1226
+ #: admin/wpmedia.php:155
1227
+ #, php-format
1228
+ #@ gmLang
1229
+ msgid "%s selected"
1230
+ msgstr "%s selectionné"
1231
+
1232
+ #: admin/galleries.php:133
1233
+ #: admin/gmedia.php:285
1234
+ #: admin/terms.php:158
1235
+ #: admin/wpmedia.php:161
1236
+ #@ gmLang
1237
+ msgid "Show only selected items"
1238
+ msgstr "Afficher seulement les items sélectionnés"
1239
+
1240
+ #: admin/galleries.php:134
1241
+ #: admin/gmedia.php:290
1242
+ #: admin/terms.php:160
1243
+ #: admin/wpmedia.php:162
1244
+ #@ gmLang
1245
+ msgid "Clear selected items"
1246
+ msgstr "Effacer la sélection des items"
1247
+
1248
+ #: admin/galleries.php:186
1249
+ #: inc/media-upload.php:291
1250
+ #@ gmLang
1251
+ msgid "Module broken <br>Reinstall module"
1252
+ msgstr "Module disfonctionnel <br>Réinstaller le module"
1253
+
1254
+ #: admin/galleries.php:206
1255
+ #: admin/galleries.php:207
1256
+ #: inc/media-upload.php:308
1257
+ #@ gmLang
1258
+ msgid "Shortcode"
1259
+ msgstr ""
1260
+
1261
+ #: admin/galleries.php:213
1262
+ #: inc/media-upload.php:313
1263
+ #@ gmLang
1264
+ msgid "Module"
1265
+ msgstr ""
1266
+
1267
+ #: admin/galleries.php:214
1268
+ #: admin/gmedia.php:415
1269
+ #: admin/gmedia.php:531
1270
+ #: admin/gmedia.php:771
1271
+ #: admin/wpmedia.php:192
1272
+ #: inc/media-upload.php:314
1273
+ #@ gmLang
1274
+ msgid "Type"
1275
+ msgstr ""
1276
+
1277
+ #: admin/galleries.php:215
1278
+ #: admin/gmedia.php:781
1279
+ #: inc/media-upload.php:315
1280
+ #@ gmLang
1281
+ msgid "Last Edited"
1282
+ msgstr "Dernière modification"
1283
+
1284
+ #: admin/galleries.php:217
1285
+ #: inc/media-upload.php:317
1286
+ #@ gmLang
1287
+ msgid "Source"
1288
+ msgstr ""
1289
+
1290
+ #: admin/galleries.php:222
1291
+ #: admin/galleries.php:565
1292
+ #: inc/media-upload.php:322
1293
+ #@ gmLang
1294
+ msgid "Selected Gmedia"
1295
+ msgstr "Gmedia sélectionné"
1296
+
1297
+ #: admin/galleries.php:224
1298
+ #: inc/media-upload.php:325
1299
+ #, php-format
1300
+ #@ gmLang
1301
+ msgid "Show %d items in Gmedia Library"
1302
+ msgstr "Afficher %d items dans la bibliothèque Gmedia"
1303
+
1304
+ #: admin/galleries.php:230
1305
+ #: admin/galleries.php:563
1306
+ #: admin/gmedia.php:172
1307
+ #: admin/terms.php:115
1308
+ #: admin/terms.php:657
1309
+ #: inc/media-upload.php:332
1310
+ #@ gmLang
1311
+ msgid "Categories"
1312
+ msgstr "Catégories"
1313
+
1314
+ #: admin/galleries.php:235
1315
+ #: admin/galleries.php:561
1316
+ #: admin/gmedia.php:176
1317
+ #: admin/terms.php:111
1318
+ #: admin/terms.php:653
1319
+ #: inc/media-upload.php:337
1320
+ #@ gmLang
1321
+ msgid "Albums"
1322
+ msgstr ""
1323
+
1324
+ #: admin/galleries.php:240
1325
+ #: admin/galleries.php:562
1326
+ #: admin/gmedia.php:179
1327
+ #: admin/gmedia.php:395
1328
+ #: admin/gmedia.php:511
1329
+ #: admin/import.php:306
1330
+ #: admin/terms.php:113
1331
+ #: admin/terms.php:368
1332
+ #: admin/terms.php:655
1333
+ #: inc/media-upload.php:342
1334
+ #@ gmLang
1335
+ #@ default
1336
+ msgid "Tags"
1337
+ msgstr "Étiquettes"
1338
+
1339
+ #: admin/galleries.php:245
1340
+ #: inc/image-editor.php:50
1341
+ #: inc/media-upload.php:347
1342
+ #@ gmLang
1343
+ msgid "Filters"
1344
+ msgstr "Filtres"
1345
+
1346
+ #: admin/galleries.php:264
1347
+ #: admin/gmedia.php:848
1348
+ #: admin/terms.php:351
1349
+ #: admin/terms.php:526
1350
+ #: admin/wpmedia.php:234
1351
+ #: inc/media-upload.php:377
1352
+ #: inc/media-upload.php:556
1353
+ #@ gmLang
1354
+ msgid "No items to show."
1355
+ msgstr "Aucun item a afficher"
1356
+
1357
+ #: admin/galleries.php:281
1358
+ #: admin/galleries.php:869
1359
+ #@ default
1360
+ msgid "Choose Module for Gallery"
1361
+ msgstr ""
1362
+
1363
+ #: admin/galleries.php:311
1364
+ #: admin/galleries.php:910
1365
+ #: admin/modules.php:114
1366
+ #: admin/modules.php:159
1367
+ #@ gmLang
1368
+ msgid "Version"
1369
+ msgstr ""
1370
+
1371
+ #: admin/galleries.php:319
1372
+ #: admin/galleries.php:918
1373
+ #@ gmLang
1374
+ msgid "No installed modules"
1375
+ msgstr "Aucun module d'installé"
1376
+
1377
+ #: admin/galleries.php:370
1378
+ #: inc/shortcodes.php:66
1379
+ #, php-format
1380
+ #@ default
1381
+ msgid "No gallery with ID #%s in database"
1382
+ msgstr ""
1383
+
1384
+ #: admin/galleries.php:450
1385
+ #, php-format
1386
+ #@ default
1387
+ msgid "Module `%s` is broken. Choose another module from the list and save settings"
1388
+ msgstr ""
1389
+
1390
+ #: admin/galleries.php:453
1391
+ #, php-format
1392
+ #@ default
1393
+ msgid "Can't get module with name `%s`. Choose module from the list and save settings"
1394
+ msgstr ""
1395
+
1396
+ #: admin/galleries.php:456
1397
+ #@ default
1398
+ msgid "Module is not selected for this gallery. Choose module from the list and save settings"
1399
+ msgstr ""
1400
+
1401
+ #: admin/galleries.php:477
1402
+ #@ gmLang
1403
+ msgid "Manage Galleries"
1404
+ msgstr "Gestion des galeries"
1405
+
1406
+ #: admin/galleries.php:482
1407
+ #@ gmLang
1408
+ msgid "Cancel preview module"
1409
+ msgstr "Annuler la visualisation du module"
1410
+
1411
+ #: admin/galleries.php:483
1412
+ #@ gmLang
1413
+ msgid "Save with new module"
1414
+ msgstr "Sauvegarder avec le nouveau module"
1415
+
1416
+ #: admin/galleries.php:488
1417
+ #@ default
1418
+ msgid "Confirm reset gallery options"
1419
+ msgstr ""
1420
+
1421
+ #: admin/galleries.php:488
1422
+ #@ gmLang
1423
+ msgid "Reset to default"
1424
+ msgstr "Réinitialiser à la valeur de défaut"
1425
+
1426
+ #: admin/galleries.php:490
1427
+ #@ gmLang
1428
+ msgid "Save"
1429
+ msgstr "Sauvegarder"
1430
+
1431
+ #: admin/galleries.php:507
1432
+ #@ gmLang
1433
+ msgid "This module is broken or outdated. Please, go to Modules page and update/install module."
1434
+ msgstr "Ce module est disfonctionnel ou pas à jour. S'il vous plaît, aller à la page Module et metter à jour ou installer le module."
1435
+
1436
+ #: admin/galleries.php:511
1437
+ #@ gmLang
1438
+ msgid "General Settings"
1439
+ msgstr "Paramètres généraux"
1440
+
1441
+ #: admin/galleries.php:522
1442
+ #@ default
1443
+ msgid "Gallery module:"
1444
+ msgstr ""
1445
+
1446
+ #: admin/galleries.php:524
1447
+ #@ default
1448
+ msgid "Preview module:"
1449
+ msgstr ""
1450
+
1451
+ #: admin/galleries.php:525
1452
+ #, php-format
1453
+ #@ default
1454
+ msgid "Note: Module changed to %s, but not saved yet"
1455
+ msgstr ""
1456
+
1457
+ #: admin/galleries.php:528
1458
+ #@ gmLang
1459
+ msgid "Gallery author:"
1460
+ msgstr "Auteur de la galerie:"
1461
+
1462
+ #: admin/galleries.php:530
1463
+ #@ gmLang
1464
+ msgid "Click to choose author for gallery"
1465
+ msgstr "Cliquez pour choisir l'auteur de la galerie"
1466
+
1467
+ #: admin/galleries.php:530
1468
+ #@ default
1469
+ msgid "(no author / shared albums)"
1470
+ msgstr ""
1471
+
1472
+ #: admin/galleries.php:532
1473
+ #@ default
1474
+ msgid "Note: Author changed but not saved yet. You can see Albums list only of chosen author"
1475
+ msgstr ""
1476
+
1477
+ #: admin/galleries.php:539
1478
+ #@ default
1479
+ msgid "Shortcode:"
1480
+ msgstr ""
1481
+
1482
+ #: admin/galleries.php:556
1483
+ #@ gmLang
1484
+ msgid "Show supported files from"
1485
+ msgstr "Afficher les fichiers prises en charge à partir de"
1486
+
1487
+ #: admin/galleries.php:566
1488
+ #: admin/gmedia.php:118
1489
+ #: admin/gmedia.php:120
1490
+ #: admin/wpmedia.php:82
1491
+ #: admin/wpmedia.php:84
1492
+ #@ gmLang
1493
+ msgid "Filter"
1494
+ msgstr "Filtre"
1495
+
1496
+ #: admin/galleries.php:586
1497
+ #@ gmLang
1498
+ msgid "Choose Categories"
1499
+ msgstr "choisir les catégories"
1500
+
1501
+ #: admin/galleries.php:587
1502
+ #: admin/galleries.php:588
1503
+ #@ gmLang
1504
+ msgid "Choose Categories..."
1505
+ msgstr "choisir les catégories"
1506
+
1507
+ #: admin/galleries.php:607
1508
+ #@ gmLang
1509
+ msgid "Choose Tags"
1510
+ msgstr "Choisir les étiquettes"
1511
+
1512
+ #: admin/galleries.php:608
1513
+ #: admin/galleries.php:609
1514
+ #@ gmLang
1515
+ msgid "Choose Tags..."
1516
+ msgstr "Choisi les étiquettes..."
1517
+
1518
+ #: admin/galleries.php:630
1519
+ #@ gmLang
1520
+ msgid "Choose Albums"
1521
+ msgstr "Choisir les albums"
1522
+
1523
+ #: admin/galleries.php:631
1524
+ #: admin/galleries.php:632
1525
+ #@ gmLang
1526
+ msgid "Choose Albums..."
1527
+ msgstr "Choisir les albums"
1528
+
1529
+ #: admin/galleries.php:636
1530
+ #@ gmLang
1531
+ msgid "You can choose Albums from the same author as Gallery author or Albums without author"
1532
+ msgstr "Vous pouvez choisir les albums par l'auteur de la galerie ou choisir les albums sans auteur"
1533
+
1534
+ #: admin/galleries.php:641
1535
+ #@ gmLang
1536
+ msgid "Selected Gmedia IDs <small class=\"text-muted\">separated by comma</small>"
1537
+ msgstr "Sélectionner Gmedia IDs <small class=\"text-muted\">separé par une virgule</small>"
1538
+
1539
+ #: admin/galleries.php:643
1540
+ #@ gmLang
1541
+ msgid "Gmedia IDs..."
1542
+ msgstr "IDs Gmedia..."
1543
+
1544
+ #: admin/galleries.php:662
1545
+ #@ default
1546
+ msgid "Last edited:"
1547
+ msgstr ""
1548
+
1549
+ #: admin/galleries.php:668
1550
+ #@ default
1551
+ msgid "Gallery ID:"
1552
+ msgstr ""
1553
+
1554
+ #: admin/galleries.php:669
1555
+ #@ default
1556
+ msgid "Gallery URL:"
1557
+ msgstr ""
1558
+
1559
+ #: admin/galleries.php:678
1560
+ #@ gmLang
1561
+ msgid "update <a href=\"options-permalink.php\">Permalink Settings</a> if above link not working"
1562
+ msgstr "Mettre à jour <a href=\"options-permalink.php\">Paramètre Permalink </a> Si le lien ci-dessus ne fonctionne pas"
1563
+
1564
+ #: admin/galleries.php:681
1565
+ #@ default
1566
+ msgid "Gallery Preview:"
1567
+ msgstr ""
1568
+
1569
+ #: admin/gmedia.php:75
1570
+ #@ gmLang
1571
+ msgid "Selected Author:"
1572
+ msgstr "Auteur sélectionné:"
1573
+
1574
+ #: admin/gmedia.php:106
1575
+ #: admin/gmedia.php:145
1576
+ #: admin/wpmedia.php:68
1577
+ #: admin/wpmedia.php:103
1578
+ #@ gmLang
1579
+ msgid "Images"
1580
+ msgstr ""
1581
+
1582
+ #: admin/gmedia.php:107
1583
+ #: admin/gmedia.php:152
1584
+ #: admin/wpmedia.php:69
1585
+ #: admin/wpmedia.php:111
1586
+ #@ gmLang
1587
+ msgid "Audio"
1588
+ msgstr ""
1589
+
1590
+ #: admin/gmedia.php:108
1591
+ #: admin/gmedia.php:159
1592
+ #: admin/wpmedia.php:70
1593
+ #: admin/wpmedia.php:119
1594
+ #@ gmLang
1595
+ msgid "Video"
1596
+ msgstr "Vidéo"
1597
+
1598
+ #: admin/gmedia.php:118
1599
+ #: admin/wpmedia.php:82
1600
+ #@ gmLang
1601
+ msgid "Reset Filter"
1602
+ msgstr "Réinitialiser le filtre"
1603
+
1604
+ #: admin/gmedia.php:127
1605
+ #@ gmLang
1606
+ msgid "FILTER BY AUTHOR"
1607
+ msgstr "Filtrer par auteur"
1608
+
1609
+ #: admin/gmedia.php:132
1610
+ #@ gmLang
1611
+ msgid "Show all authors"
1612
+ msgstr "Afficher tous les auteurs"
1613
+
1614
+ #: admin/gmedia.php:134
1615
+ #: admin/wpmedia.php:91
1616
+ #@ gmLang
1617
+ msgid "TYPE"
1618
+ msgstr ""
1619
+
1620
+ #: admin/gmedia.php:167
1621
+ #: admin/wpmedia.php:127
1622
+ #@ gmLang
1623
+ msgid "Other"
1624
+ msgstr "Autre"
1625
+
1626
+ #: admin/gmedia.php:168
1627
+ #@ gmLang
1628
+ msgid "COLLECTIONS"
1629
+ msgstr ""
1630
+
1631
+ #: admin/gmedia.php:195
1632
+ #@ gmLang
1633
+ msgid "Toggle Edit Mode"
1634
+ msgstr "Basculer en mode d'édition"
1635
+
1636
+ #: admin/gmedia.php:209
1637
+ #@ gmLang
1638
+ msgid "Enter Edit Mode"
1639
+ msgstr "Entrer en mode d'édition"
1640
+
1641
+ #: admin/gmedia.php:223
1642
+ #: admin/gmedia.php:294
1643
+ #@ gmLang
1644
+ msgid "Quick Gallery from Selected"
1645
+ msgstr "Galerie instantannée pour sélectionner"
1646
+
1647
+ #: admin/gmedia.php:229
1648
+ #@ gmLang
1649
+ msgid "Assign Category..."
1650
+ msgstr "Attribuer une catégorie..."
1651
+
1652
+ #: admin/gmedia.php:235
1653
+ #@ gmLang
1654
+ msgid "Move to Album..."
1655
+ msgstr "Déplacer un album..."
1656
+
1657
+ #: admin/gmedia.php:246
1658
+ #@ gmLang
1659
+ msgid "Delete Tags..."
1660
+ msgstr "Supprimer les étiquettes..."
1661
+
1662
+ #: admin/gmedia.php:260
1663
+ #@ gmLang
1664
+ msgid "Update Metadata in Database"
1665
+ msgstr "Mise à jour des Metadatas dans la base de données"
1666
+
1667
+ #: admin/gmedia.php:265
1668
+ #@ gmLang
1669
+ msgid "Exit Edit Mode"
1670
+ msgstr "Sortir du mode d'édition"
1671
+
1672
+ #: admin/gmedia.php:287
1673
+ #@ gmLang
1674
+ msgid "Show all gmedia items"
1675
+ msgstr "Afficher tous les items Gmedia"
1676
+
1677
+ #: admin/gmedia.php:311
1678
+ #: admin/terms.php:259
1679
+ #: admin/terms.php:391
1680
+ #@ gmLang
1681
+ msgid "Info:"
1682
+ msgstr ""
1683
+
1684
+ #: admin/gmedia.php:367
1685
+ #: admin/gmedia.php:483
1686
+ #: admin/import.php:305
1687
+ #@ gmLang
1688
+ #@ default
1689
+ msgid "Album"
1690
+ msgstr ""
1691
+
1692
+ #: admin/gmedia.php:382
1693
+ #: admin/gmedia.php:498
1694
+ #: admin/gmedia.php:655
1695
+ #: admin/import.php:304
1696
+ #@ gmLang
1697
+ #@ default
1698
+ msgid "Category"
1699
+ msgstr "Catégorie"
1700
+
1701
+ #: admin/gmedia.php:421
1702
+ #: admin/gmedia.php:537
1703
+ #: inc/media-upload.php:530
1704
+ #@ gmLang
1705
+ msgid "Size"
1706
+ msgstr "Dimension "
1707
+
1708
+ #: admin/gmedia.php:425
1709
+ #: admin/gmedia.php:541
1710
+ #: admin/gmedia.php:725
1711
+ #@ gmLang
1712
+ msgid "Filename"
1713
+ msgstr "Nom du fichier"
1714
+
1715
+ #: admin/gmedia.php:432
1716
+ #: admin/gmedia.php:548
1717
+ #@ gmLang
1718
+ msgid "Last Modified Date"
1719
+ msgstr "Date de la dernière modification"
1720
+
1721
+ #: admin/gmedia.php:444
1722
+ #@ gmLang
1723
+ msgid "Edit Data"
1724
+ msgstr "Modifier les données"
1725
+
1726
+ #: admin/gmedia.php:448
1727
+ #: admin/gmedia.php:580
1728
+ #@ gmLang
1729
+ msgid "Edit Image"
1730
+ msgstr "Modifier l'image"
1731
+
1732
+ #: admin/gmedia.php:450
1733
+ #: admin/gmedia.php:560
1734
+ #: admin/gmedia.php:583
1735
+ #@ gmLang
1736
+ msgid "View Original"
1737
+ msgstr "Voir l'original"
1738
+
1739
+ #: admin/gmedia.php:454
1740
+ #: admin/gmedia.php:587
1741
+ #, php-format
1742
+ #@ gmLang
1743
+ msgid ""
1744
+ "You are about to permanently delete %s file.\n"
1745
+ "\\r'Cancel' to stop, 'OK' to delete."
1746
+ msgstr ""
1747
+ "Vous êtes sur le point de supprimer définitivement le fichier %s.\n"
1748
+ "\\r'Annuler ' pour arrêter,' Continuer' pour supprimer."
1749
+
1750
+ #: admin/gmedia.php:454
1751
+ #: admin/gmedia.php:588
1752
+ #@ gmLang
1753
+ msgid "Delete"
1754
+ msgstr "Supprimer"
1755
+
1756
+ #: admin/gmedia.php:455
1757
+ #, php-format
1758
+ #@ gmLang
1759
+ msgid ""
1760
+ "You are about to delete record from DB for %s file.\n"
1761
+ "\\r'Cancel' to stop, 'OK' to delete."
1762
+ msgstr ""
1763
+ "Vous êtes sur le point de supprimer l'enregistrement DB pour le fichier %s.\n"
1764
+ "\\r'Annuler ' pour arrêter,' Continuer' pour supprimer."
1765
+
1766
+ #: admin/gmedia.php:455
1767
+ #@ gmLang
1768
+ msgid "Delete DB record (leave file on the server)"
1769
+ msgstr "Suppression de l'enregistrement DB (laisser le fichier sur le serveur)"
1770
+
1771
+ #: admin/gmedia.php:608
1772
+ #@ gmLang
1773
+ msgid "Link URL"
1774
+ msgstr "Lien URL"
1775
+
1776
+ #: admin/gmedia.php:633
1777
+ #@ gmLang
1778
+ msgid "Cover"
1779
+ msgstr "Couverture"
1780
+
1781
+ #: admin/gmedia.php:636
1782
+ #@ gmLang
1783
+ msgid "Gmedia ID or Image URL"
1784
+ msgstr "ID Gmedia ou l'URL de l'image"
1785
+
1786
+ #: admin/gmedia.php:698
1787
+ #@ gmLang
1788
+ msgid "Album "
1789
+ msgstr ""
1790
+
1791
+ #: admin/gmedia.php:716
1792
+ #@ gmLang
1793
+ msgid "Tags "
1794
+ msgstr "Étiquettes"
1795
+
1796
+ #: admin/gmedia.php:773
1797
+ #@ gmLang
1798
+ msgid "File Size"
1799
+ msgstr "Dimension du fichier"
1800
+
1801
+ #: admin/gmedia.php:777
1802
+ #@ gmLang
1803
+ msgid "Dimensions"
1804
+ msgstr ""
1805
+
1806
+ #: admin/gmedia.php:780
1807
+ #@ gmLang
1808
+ msgid "Uploaded"
1809
+ msgstr "Télécharger"
1810
+
1811
+ #: admin/gmedia.php:851
1812
+ #: inc/media-upload.php:559
1813
+ #@ gmLang
1814
+ msgid "Add Media"
1815
+ msgstr "Ajouter un média"
1816
+
1817
+ #: admin/gmedia.php:862
1818
+ #@ gmLang
1819
+ msgid "Back to top"
1820
+ msgstr "Retour en haut de la page"
1821
+
1822
+ #: admin/import.php:24
1823
+ #@ default
1824
+ msgid "You do not have permission to upload files."
1825
+ msgstr ""
1826
+
1827
+ #: admin/import.php:75
1828
+ #: update.php:260
1829
+ #@ gmLang
1830
+ msgid "Something went wrong..."
1831
+ msgstr "Quelque chose a mal tourné ..."
1832
+
1833
+ #: admin/import.php:88
1834
+ #: update.php:276
1835
+ #, php-format
1836
+ #@ gmLang
1837
+ msgid "File not exists: %s"
1838
+ msgstr "Fichier inexistant: %s"
1839
+
1840
+ #: admin/import.php:97
1841
+ #: admin/import.php:159
1842
+ #: admin/import.php:171
1843
+ #: update.php:331
1844
+ #: update.php:342
1845
+ #, php-format
1846
+ #@ gmLang
1847
+ msgid "Unable to create directory `%s`. Is its parent directory writable by the server?"
1848
+ msgstr "Impossible de créer le répertoire `%s`. Est-ce que le répertoire parent est accessible en mode écriture par le serveur?"
1849
+
1850
+ #: admin/import.php:104
1851
+ #, php-format
1852
+ #@ gmLang
1853
+ msgid "Directory `%s` or its subfolders are not writable by the server."
1854
+ msgstr "Le répertoire `%s` ou ses sous-dossiers ne sont pas accessibles en écriture par le serveur."
1855
+
1856
+ #: admin/import.php:110
1857
+ #, php-format
1858
+ #@ gmLang
1859
+ msgid "Can't copy file from `%s` to `%s`"
1860
+ msgstr "Vous ne pouvez pas copier le fichier de `%s` dans`%s`"
1861
+
1862
+ #: admin/import.php:166
1863
+ #: admin/import.php:178
1864
+ #: update.php:337
1865
+ #: update.php:348
1866
+ #, php-format
1867
+ #@ gmLang
1868
+ msgid "Directory `%s` is not writable by the server."
1869
+ msgstr "Le répertoire `%s` n'est pas accessible en mode écriture par le serveur."
1870
+
1871
+ #: admin/import.php:245
1872
+ #: inc/core.php:1433
1873
+ #@ gmLang
1874
+ msgid "Could not read image size. Invalid image was deleted."
1875
+ msgstr "Impossible de lire la taille de l'image. L'image non valide a été supprimé."
1876
+
1877
+ #: admin/import.php:296
1878
+ #: update.php:419
1879
+ #, php-format
1880
+ #@ gmLang
1881
+ msgid "success (ID #%s)"
1882
+ msgstr "Succès (ID #%s)"
1883
+
1884
+ #: admin/import.php:386
1885
+ #, php-format
1886
+ #@ gmLang
1887
+ msgid "Folder `%s` is empty"
1888
+ msgstr "Le dossier `%s` est vide"
1889
+
1890
+ #: admin/import.php:389
1891
+ #@ gmLang
1892
+ msgid "No folder chosen"
1893
+ msgstr "Aucun dossier choisi"
1894
+
1895
+ #: admin/import.php:394
1896
+ #@ default
1897
+ msgid "Import from Flagallery plugin"
1898
+ msgstr ""
1899
+
1900
+ #: admin/import.php:416
1901
+ #: admin/import.php:453
1902
+ #, php-format
1903
+ #@ gmLang
1904
+ msgid "Import `%s` gallery"
1905
+ msgstr "Importer la galerie `%s`"
1906
+
1907
+ #: admin/import.php:420
1908
+ #: admin/import.php:457
1909
+ #@ gmLang
1910
+ msgid "gallery contains 0 images"
1911
+ msgstr "La galerie contient aucune image."
1912
+
1913
+ #: admin/import.php:427
1914
+ #: admin/import.php:463
1915
+ #@ gmLang
1916
+ msgid "No gallery chosen"
1917
+ msgstr "Aucune galerie choisie"
1918
+
1919
+ #: admin/import.php:431
1920
+ #@ default
1921
+ msgid "Import from NextGen plugin"
1922
+ msgstr ""
1923
+
1924
+ #: admin/import.php:486
1925
+ #@ gmLang
1926
+ msgid "No items chosen"
1927
+ msgstr "Aucun item choisi"
1928
+
1929
+ #: admin/modules.php:45
1930
+ #@ gmLang
1931
+ msgid "Error loading remote xml..."
1932
+ msgstr "Erreur lors du chargement xml à distance ..."
1933
+
1934
+ #: admin/modules.php:65
1935
+ #@ default
1936
+ msgid "Install Module ZIP"
1937
+ msgstr ""
1938
+
1939
+ #: admin/modules.php:67
1940
+ #@ gmLang
1941
+ msgid "Installed Modules"
1942
+ msgstr "Modules installés"
1943
+
1944
+ #: admin/modules.php:100
1945
+ #: admin/modules.php:167
1946
+ #@ gmLang
1947
+ msgid "Loading..."
1948
+ msgstr "Chargement..."
1949
+
1950
+ #: admin/modules.php:100
1951
+ #@ gmLang
1952
+ msgid "Update Module"
1953
+ msgstr "Mise à jour du module"
1954
+
1955
+ #: admin/modules.php:120
1956
+ #: admin/modules.php:165
1957
+ #@ gmLang
1958
+ msgid "View Demo"
1959
+ msgstr "Visionner le Démo"
1960
+
1961
+ #: admin/modules.php:140
1962
+ #@ gmLang
1963
+ msgid "Not Installed Modules"
1964
+ msgstr "Aucun module d'installé"
1965
+
1966
+ #: admin/modules.php:167
1967
+ #@ gmLang
1968
+ msgid "Install Module"
1969
+ msgstr "Installer module"
1970
+
1971
+ #: admin/modules.php:184
1972
+ #@ default
1973
+ msgid "Install a plugin in .zip format"
1974
+ msgstr ""
1975
+
1976
+ #: admin/modules.php:187
1977
+ #@ default
1978
+ msgid "If you have a module in a .zip format, you may install it by uploading it here."
1979
+ msgstr ""
1980
+
1981
+ #: admin/modules.php:189
1982
+ #@ default
1983
+ msgid "Module zip file"
1984
+ msgstr ""
1985
+
1986
+ #: admin/modules.php:194
1987
+ #@ gmLang
1988
+ msgid "Install"
1989
+ msgstr "Installer"
1990
+
1991
+ #: admin/processor.php:91
1992
+ #: admin/processor.php:457
1993
+ #: admin/processor.php:462
1994
+ #@ gmLang
1995
+ msgid "You are not allowed to be here"
1996
+ msgstr "Vous n'êtes pas autoriser à être ici"
1997
+
1998
+ #: admin/processor.php:97
1999
+ #@ gmLang
2000
+ msgid "You are not allowed to manage galleries"
2001
+ msgstr "Vous n'êtes pas autoriser à gérer les galeries"
2002
+
2003
+ #: admin/processor.php:103
2004
+ #: admin/processor.php:609
2005
+ #@ gmLang
2006
+ msgid "Gallery Name is not specified"
2007
+ msgstr "Le nom de la galerie n'est pas spécifiée"
2008
+
2009
+ #: admin/processor.php:107
2010
+ #: admin/processor.php:613
2011
+ #@ gmLang
2012
+ msgid "Gallery name can't be only digits"
2013
+ msgstr "Le nom de la galerie ne peut pas contenir que des chiffres"
2014
+
2015
+ #: admin/processor.php:111
2016
+ #@ gmLang
2017
+ msgid "Choose gmedia from library for quick gallery"
2018
+ msgstr "Choisissez Gmedia pour la bibliothèque de galerie instantannée"
2019
+
2020
+ #: admin/processor.php:134
2021
+ #, php-format
2022
+ #@ gmLang
2023
+ msgid "Gallery \"%s\" successfuly saved. Shortcode: [gmedia id=%d]"
2024
+ msgstr "La galerie \"%s\" a été sauvegardée avec succès. Shortcode: [gmedia id=%d]"
2025
+
2026
+ #: admin/processor.php:179
2027
+ #, php-format
2028
+ #@ gmLang
2029
+ msgid "%d items now uncategorized"
2030
+ msgstr "%d items sont maintenant non classés"
2031
+
2032
+ #: admin/processor.php:245
2033
+ #: inc/db.connect.php:2735
2034
+ #@ default
2035
+ msgid "Could not update statuses for gmedia items in the database"
2036
+ msgstr ""
2037
+
2038
+ #: admin/processor.php:386
2039
+ #: admin/processor.php:401
2040
+ #, php-format
2041
+ #@ gmLang
2042
+ msgid "%d items updated successfuly"
2043
+ msgstr "%d items ont été mises à jour avec succès"
2044
+
2045
+ #: admin/processor.php:434
2046
+ #, php-format
2047
+ #@ gmLang
2048
+ msgid "%d item(s) deleted successfuly"
2049
+ msgstr "%d item(s) ont été supprimés avec succès"
2050
+
2051
+ #: admin/processor.php:436
2052
+ #, php-format
2053
+ #@ gmLang
2054
+ msgid "%d record(s) deleted from database successfuly. Original file(s) safe"
2055
+ msgstr "%d d'enregistrement(s) supprimés de la base de données avec succès. Fichier(s) d'origine sont demeurés intact."
2056
+
2057
+ #: admin/processor.php:450
2058
+ #@ gmLang
2059
+ msgid "You are not allowed to delete files"
2060
+ msgstr "Vous n'êtes pas autoriser à supprimer des fichiers"
2061
+
2062
+ #: admin/processor.php:496
2063
+ #@ gmLang
2064
+ msgid "You are not allowed to delete terms"
2065
+ msgstr "Vous n'etes pas autoriser à supprimer des termes"
2066
+
2067
+ #: admin/processor.php:585
2068
+ #@ gmLang
2069
+ msgid "You are not allowed to manage tags"
2070
+ msgstr "Vous n'êtes pas autoriser à gérer les étiquettes"
2071
+
2072
+ #: admin/processor.php:591
2073
+ #: admin/processor.php:765
2074
+ #@ gmLang
2075
+ msgid "You are not allowed to manage gmedia galleries"
2076
+ msgstr "Vous n'êtes pas autoriser à gérer les galeries Gmedia"
2077
+
2078
+ #: admin/processor.php:617
2079
+ #@ gmLang
2080
+ msgid "Something goes wrong... Choose module, please"
2081
+ msgstr "Quelque chose ne va pas ... Choisissez un module, s'il vous plaît"
2082
+
2083
+ #: admin/processor.php:622
2084
+ #@ gmLang
2085
+ msgid "Choose gallery source, please (tags, albums, categories...)"
2086
+ msgstr "Choisissez la source de la galerie, tel que étiquettes, albums, catégories..."
2087
+
2088
+ #: admin/processor.php:652
2089
+ #: admin/processor.php:712
2090
+ #, php-format
2091
+ #@ default
2092
+ msgid "Can't load data from `%s` module"
2093
+ msgstr ""
2094
+
2095
+ #: admin/processor.php:670
2096
+ #: admin/processor.php:682
2097
+ #, php-format
2098
+ #@ gmLang
2099
+ msgid "Gallery #%d successfuly saved"
2100
+ msgstr "La galerie #%d a été sauvegardée avec succès"
2101
+
2102
+ #: admin/processor.php:723
2103
+ #@ gmLang
2104
+ msgid "Gallery settings are reset"
2105
+ msgstr "Les paramètres de la galerie sont réinitialisés"
2106
+
2107
+ #: admin/processor.php:738
2108
+ #, php-format
2109
+ #@ gmLang
2110
+ msgid "Error while delete gallery #%d"
2111
+ msgstr "Une erreur est survenue lors de la suppression de la galerie #%d"
2112
+
2113
+ #: admin/processor.php:771
2114
+ #@ gmLang
2115
+ msgid "You are not allowed to manage gmedia modules"
2116
+ msgstr "Vous n'êtes pas autoriser à gérer les modules Gmedia"
2117
+
2118
+ #: admin/processor.php:778
2119
+ #, php-format
2120
+ #@ flag
2121
+ msgid "The uploaded file could not be moved to %s"
2122
+ msgstr ""
2123
+
2124
+ #: admin/processor.php:798
2125
+ #, php-format
2126
+ #@ flag
2127
+ msgid "The `%s` file unzipped to module's directory"
2128
+ msgstr ""
2129
+
2130
+ #: admin/processor.php:808
2131
+ #@ gmLang
2132
+ msgid "You are not allowed to change gmedia settings"
2133
+ msgstr "Vous n'êtes pas autorises à modifier les paramèetres de Gmedia"
2134
+
2135
+ #: admin/processor.php:822
2136
+ #@ gmLang
2137
+ msgid "License Key deactivated"
2138
+ msgstr "La clef de la license a été désactivée"
2139
+
2140
+ #: admin/processor.php:881
2141
+ #@ gmLang
2142
+ msgid "Settings saved"
2143
+ msgstr "Paramètres sauvegardés"
2144
+
2145
+ #: admin/processor.php:911
2146
+ #@ gmLang
2147
+ msgid "License Key activated successfully"
2148
+ msgstr "La clef de la license a été activée avec succès"
2149
+
2150
+ #: admin/processor.php:916
2151
+ #@ gmLang
2152
+ msgid "Error"
2153
+ msgstr "Erreur"
2154
+
2155
+ #: admin/processor.php:921
2156
+ #@ gmLang
2157
+ msgid "Empty License Key"
2158
+ msgstr "Aucune clef de license"
2159
+
2160
+ #: admin/processor.php:944
2161
+ #@ gmLang
2162
+ msgid "All settings set to default"
2163
+ msgstr "Tous les paramètres sont réinitialisés à leurs valeurs de défaut "
2164
+
2165
+ #: admin/processor.php:949
2166
+ #@ gmLang
2167
+ msgid "You are not allowed to import media in Gmedia Library"
2168
+ msgstr "Vous n'êtes pas autoriser à importer des médias dans la bibliothèque Gmedia"
2169
+
2170
+ #: admin/settings.php:20
2171
+ #@ default
2172
+ msgid "Reset all Gmedia settings?"
2173
+ msgstr ""
2174
+
2175
+ #: admin/settings.php:20
2176
+ #@ gmLang
2177
+ msgid "Reset Settings"
2178
+ msgstr "Réinitialiser les paramètres"
2179
+
2180
+ #: admin/settings.php:21
2181
+ #: admin/terms.php:783
2182
+ #@ gmLang
2183
+ msgid "Update"
2184
+ msgstr "Mise à jour"
2185
+
2186
+ #: admin/settings.php:32
2187
+ #@ gmLang
2188
+ msgid "Premium Settings"
2189
+ msgstr "Paramètres Premium "
2190
+
2191
+ #: admin/settings.php:34
2192
+ #@ gmLang
2193
+ msgid "Roles/Capabilities Manager"
2194
+ msgstr "Rôles et autorisations"
2195
+
2196
+ #: admin/settings.php:35
2197
+ #@ gmLang
2198
+ msgid "Other Settings"
2199
+ msgstr "Autres paramètres"
2200
+
2201
+ #: admin/settings.php:39
2202
+ #@ default
2203
+ msgid "Enter License Key to remove backlink label from premium gallery modules."
2204
+ msgstr ""
2205
+
2206
+ #: admin/settings.php:43
2207
+ #@ gmLang
2208
+ msgid "License Key"
2209
+ msgstr "Clef de la license"
2210
+
2211
+ #: admin/settings.php:54
2212
+ #@ gmLang
2213
+ msgid "Activate Key"
2214
+ msgstr "Clef d'activation"
2215
+
2216
+ #: admin/settings.php:60
2217
+ #@ gmLang
2218
+ msgid "Select the lowest role which should be able to access the follow capabilities. Gmedia Gallery supports the standard roles from WordPress."
2219
+ msgstr "Choisir le rôle le plus faible rôle qui devrait être en mesure d'accéder à des capacités de suivi. Galerie Gmedia prend en charge les rôles standard de WordPress."
2220
+
2221
+ #: admin/settings.php:66
2222
+ #@ gmLang
2223
+ msgid "Who can view Gmedia Gallery admin pages"
2224
+ msgstr "Qui peut voir les pages d'administration de Galerie Gmedia"
2225
+
2226
+ #: admin/settings.php:71
2227
+ #@ gmLang
2228
+ msgid "Upload Media Files"
2229
+ msgstr "Mise à jour des fichiers médias"
2230
+
2231
+ #: admin/settings.php:74
2232
+ #@ gmLang
2233
+ msgid "Who can upload files to Gmedia Library"
2234
+ msgstr "Qui peut télécharger des fichiers dans la bibiothèque Gmedia"
2235
+
2236
+ #: admin/settings.php:78
2237
+ #@ gmLang
2238
+ msgid "Import Media Files"
2239
+ msgstr "Importer des fichiers medias "
2240
+
2241
+ #: admin/settings.php:81
2242
+ #@ gmLang
2243
+ msgid "Who can import files to Gmedia Library"
2244
+ msgstr "Qui peut importer des fichiers dans la bibliothèque Gmedia"
2245
+
2246
+ #: admin/settings.php:86
2247
+ #@ gmLang
2248
+ msgid "Show Others Media in Library"
2249
+ msgstr "Afficher d'autres médias dans la bibliothèque"
2250
+
2251
+ #: admin/settings.php:89
2252
+ #@ gmLang
2253
+ msgid "Who can see files uploaded by other users"
2254
+ msgstr "Qui peut voir les fichiers téléchargés par les utilisateurs"
2255
+
2256
+ #: admin/settings.php:92
2257
+ #@ gmLang
2258
+ msgid "Edit Media"
2259
+ msgstr "Éditer le média"
2260
+
2261
+ #: admin/settings.php:95
2262
+ #@ gmLang
2263
+ msgid "Who can edit media title, description and other properties of uploaded files"
2264
+ msgstr "Qui peut modifier le titre des médias, la description et d'autres propriétés des fichiers téléchargés"
2265
+
2266
+ #: admin/settings.php:99
2267
+ #@ gmLang
2268
+ msgid "Edit Others Media"
2269
+ msgstr "Éditer d'autres médias"
2270
+
2271
+ #: admin/settings.php:102
2272
+ #@ gmLang
2273
+ msgid "Who can edit files, albums/tags and galleries of other users"
2274
+ msgstr "Qui peut éditer des fichiers, des albums, des étiquettes et des galeries d'autres utilisateurs"
2275
+
2276
+ #: admin/settings.php:106
2277
+ #@ gmLang
2278
+ msgid "Delete Media"
2279
+ msgstr "Media supprimé"
2280
+
2281
+ #: admin/settings.php:109
2282
+ #@ gmLang
2283
+ msgid "Who can delete uploaded files from Gmedia Library"
2284
+ msgstr "Qui peut supprimer les fichiers téléchargés dans la bibliothèque Gmedia"
2285
+
2286
+ #: admin/settings.php:113
2287
+ #@ gmLang
2288
+ msgid "Delete Others Media"
2289
+ msgstr "Supprimer d'autres médias"
2290
+
2291
+ #: admin/settings.php:116
2292
+ #@ gmLang
2293
+ msgid "Who can delete files, albums/tags and galleries of other users"
2294
+ msgstr "Qui peut supprimer des fichiers, des albums, des étiquettes et des galeries de d'autres utilisateurs"
2295
+
2296
+ #: admin/settings.php:124
2297
+ #@ gmLang
2298
+ msgid "Who can assign available terms to media files"
2299
+ msgstr "Qui peut attribuer les termes des fichiers multimédias"
2300
+
2301
+ #: admin/settings.php:128
2302
+ #@ gmLang
2303
+ msgid "Manage Albums"
2304
+ msgstr "Gérer les albums"
2305
+
2306
+ #: admin/settings.php:131
2307
+ #@ gmLang
2308
+ msgid "Who can create and edit own albums. It is required \"Edit Others Media\" capability to edit others and shared albums"
2309
+ msgstr "Qui peut créer et modifier ses propres albums. Il est nécessaire \\ \\\"Modifier Autres Médias \" d'avoir les autorisations d'éditer et partager d'autres albums"
2310
+
2311
+ #: admin/settings.php:134
2312
+ #@ gmLang
2313
+ msgid "Manage Tags"
2314
+ msgstr "Gérer les étiquettes"
2315
+
2316
+ #: admin/settings.php:137
2317
+ #@ gmLang
2318
+ msgid "Who can create new tags. It is required \"Edit Others Media\" capability to edit tags"
2319
+ msgstr "Qui peut créer de nouvelles étiquettes. Il est nécessaire \\ \\\"Modifier Autres Médias \" être autoriser d'éditer les étiquettes"
2320
+
2321
+ #: admin/settings.php:140
2322
+ #@ gmLang
2323
+ msgid "Delete Terms"
2324
+ msgstr "Termes supprimés"
2325
+
2326
+ #: admin/settings.php:143
2327
+ #@ gmLang
2328
+ msgid "Who can delete own albums. It is required \"Delete Others Media\" capability to delete others terms"
2329
+ msgstr "Qui peut supprimer ses propres albums. Il est nécessaire \\ \\\"Supprimer autres médias \" d'être autoriser à supprimer d'autres termes"
2330
+
2331
+ #: admin/settings.php:148
2332
+ #@ gmLang
2333
+ msgid "Galleries"
2334
+ msgstr "Galeries"
2335
+
2336
+ #: admin/settings.php:151
2337
+ #@ gmLang
2338
+ msgid "Who can create, edit and delete own galleries"
2339
+ msgstr "Qui peut créer, modifier et supprimer ses propres galeries"
2340
+
2341
+ #: admin/settings.php:158
2342
+ #@ gmLang
2343
+ msgid "Who can manage modules"
2344
+ msgstr "Qui peut gérer les modules"
2345
+
2346
+ #: admin/settings.php:165
2347
+ #@ gmLang
2348
+ msgid "Who can change settings. Note: Capabilites can be changed only by administrator"
2349
+ msgstr "Qui peut modifier les paramètres. Remarque: Les autorisations peuvent être modifiées que par l'administrateur"
2350
+
2351
+ #: admin/settings.php:172
2352
+ #@ gmLang
2353
+ msgid "When delete (uninstall) plugin"
2354
+ msgstr "lors de la suppression (désinstallation) du plugin"
2355
+
2356
+ #: admin/settings.php:174
2357
+ #@ gmLang
2358
+ msgid "Delete database and all uploaded files"
2359
+ msgstr "Supprimer la base de données et tous les fichiers téléchargés"
2360
+
2361
+ #: admin/settings.php:175
2362
+ #@ gmLang
2363
+ msgid "Delete database only and leave uploaded files"
2364
+ msgstr "Supprimer la base de données seulement et laisser les fichiers téléchargés"
2365
+
2366
+ #: admin/settings.php:176
2367
+ #@ gmLang
2368
+ msgid "Do not delete database and uploaded files"
2369
+ msgstr "Ne pas supprimer la base de données et les fichiers téléchargés"
2370
+
2371
+ #: admin/settings.php:180
2372
+ #@ gmLang
2373
+ msgid "Forbid theme to format Gmedia shortcode's content"
2374
+ msgstr "Interdire le thème de formater le contenu du Gmedia shortcode"
2375
+
2376
+ #: admin/settings.php:184
2377
+ #@ gmLang
2378
+ msgid "Raw output for Gmedia Shortcode"
2379
+ msgstr "La sortie brute pour le Shortcode Gmedia "
2380
+
2381
+ #: admin/settings.php:187
2382
+ #@ gmLang
2383
+ msgid "Some themes reformat shortcodes and break it functionality (mostly when you add description to images). Turning this on should solve this problem."
2384
+ msgstr "Certains thèmes reformate les shortcodes et brissent les fonctionnalités (la plupart du temps lorsque vous ajoutez la description des images). En activant cette option devrait résoudre ce problème."
2385
+
2386
+ #: admin/settings.php:194
2387
+ #@ gmLang
2388
+ msgid "Memory Limit: "
2389
+ msgstr "Limite de mémoire:"
2390
+
2391
+ #: admin/settings.php:195
2392
+ #@ gmLang
2393
+ msgid "Memory Used: "
2394
+ msgstr "Mémoire utilisée:"
2395
+
2396
+ #: admin/settings.php:198
2397
+ #@ default
2398
+ msgid "Under constraction..."
2399
+ msgstr ""
2400
+
2401
+ #: admin/terms.php:177
2402
+ #: admin/terms.php:698
2403
+ #@ gmLang
2404
+ msgid "Name"
2405
+ msgstr "Nom"
2406
+
2407
+ #: admin/terms.php:179
2408
+ #: admin/terms.php:701
2409
+ #@ gmLang
2410
+ msgid "Album Name"
2411
+ msgstr "Nom de l'album"
2412
+
2413
+ #: admin/terms.php:190
2414
+ #: admin/terms.php:712
2415
+ #@ gmLang
2416
+ msgid "Order gmedia"
2417
+ msgstr "Ordre de tri Gmedia"
2418
+
2419
+ #: admin/terms.php:192
2420
+ #: admin/terms.php:715
2421
+ #@ gmLang
2422
+ msgid "user defined"
2423
+ msgstr "Défini par l'utilisateur"
2424
+
2425
+ #: admin/terms.php:193
2426
+ #: admin/terms.php:717
2427
+ #@ gmLang
2428
+ msgid "by ID"
2429
+ msgstr "par ID"
2430
+
2431
+ #: admin/terms.php:194
2432
+ #: admin/terms.php:719
2433
+ #@ gmLang
2434
+ msgid "by title"
2435
+ msgstr "par titre"
2436
+
2437
+ #: admin/terms.php:195
2438
+ #: admin/terms.php:721
2439
+ #@ gmLang
2440
+ msgid "by date"
2441
+ msgstr "par date"
2442
+
2443
+ #: admin/terms.php:196
2444
+ #: admin/terms.php:723
2445
+ #@ gmLang
2446
+ msgid "by last modified date"
2447
+ msgstr "par la date de la dernière modification"
2448
+
2449
+ #: admin/terms.php:197
2450
+ #: admin/terms.php:725
2451
+ #@ gmLang
2452
+ msgid "Random"
2453
+ msgstr "Au hasard"
2454
+
2455
+ #: admin/terms.php:201
2456
+ #: admin/terms.php:729
2457
+ #@ gmLang
2458
+ msgid "Sort order"
2459
+ msgstr "Ordre de tri"
2460
+
2461
+ #: admin/terms.php:247
2462
+ #@ gmLang
2463
+ msgid "Add New Album"
2464
+ msgstr "Ajouter un nouvel album"
2465
+
2466
+ #: admin/terms.php:259
2467
+ #: admin/terms.php:391
2468
+ #@ gmLang
2469
+ msgid "You are not allowed to add new terms"
2470
+ msgstr "Vous n'êtes pas autorisé à ajouter de nouveau termes"
2471
+
2472
+ #: admin/terms.php:369
2473
+ #@ default
2474
+ msgid "you can type multiple tags separated by comma"
2475
+ msgstr ""
2476
+
2477
+ #: admin/terms.php:373
2478
+ #@ gmLang
2479
+ msgid "Tag Names"
2480
+ msgstr "Nom des étiquettes"
2481
+
2482
+ #: admin/terms.php:382
2483
+ #@ gmLang
2484
+ msgid "Add New Tags"
2485
+ msgstr "Ajouter une nouvelle étiquette"
2486
+
2487
+ #: admin/terms.php:669
2488
+ #@ gmLang
2489
+ msgid "Disable Drag and Drop Sorting"
2490
+ msgstr "Désactiver le tri par glisser-déposer"
2491
+
2492
+ #: admin/terms.php:673
2493
+ #@ gmLang
2494
+ msgid "Enable Drag and Drop Sorting"
2495
+ msgstr "Autoriser le tri par glisser-déposer"
2496
+
2497
+ #: admin/terms.php:679
2498
+ #@ gmLang
2499
+ msgid "Show Album in Gmedia Library"
2500
+ msgstr "Afficher l'album dans la bibliothèque Gmedia"
2501
+
2502
+ #: admin/terms.php:692
2503
+ #@ default
2504
+ msgid "Edit Album"
2505
+ msgstr ""
2506
+
2507
+ #: admin/terms.php:752
2508
+ #@ gmLang
2509
+ msgid "Apply Status for all items in album"
2510
+ msgstr "Appliquer le statut à tous les items de l'album"
2511
+
2512
+ #: admin/terms.php:882
2513
+ #, php-format
2514
+ #@ default
2515
+ msgid "Total items: %d"
2516
+ msgstr ""
2517
+
2518
+ #: admin/upload.php:19
2519
+ #@ default
2520
+ msgid "You do not have permission to upload files in Gmedia Library."
2521
+ msgstr ""
2522
+
2523
+ #: admin/upload.php:33
2524
+ #@ gmLang
2525
+ msgid "No file name."
2526
+ msgstr "Aucun nom de fichier"
2527
+
2528
+ #: admin/upload.php:41
2529
+ #@ gmLang
2530
+ msgid "File type not allowed."
2531
+ msgstr "Ce type de fichier n'est pas permis"
2532
+
2533
+ #: admin/wpmedia.php:146
2534
+ #@ gmLang
2535
+ msgid "Import to Gmedia Library..."
2536
+ msgstr "Importer dans la bibliothèque Gmedia"
2537
+
2538
+ #: admin/wpmedia.php:185
2539
+ #@ gmLang
2540
+ msgid "Sort by filename"
2541
+ msgstr "Trier par bom de fichier"
2542
+
2543
+ #: admin/wpmedia.php:190
2544
+ #@ gmLang
2545
+ msgid "File"
2546
+ msgstr "Fichier"
2547
+
2548
+ #: constants.php:6
2549
+ #@ gmLang
2550
+ msgid "No Supported Files in Gallery"
2551
+ msgstr "Fichier non supporté dans la galerie"
2552
+
2553
+ #: grand-media.php:141
2554
+ #, php-format
2555
+ #@ gmLang
2556
+ msgid "Sorry, Gmedia Gallery works only under WordPress %s or higher"
2557
+ msgstr "Désolé, Galerie Gmedia ne fonctionne que sous WordPress %s ou supérieur"
2558
+
2559
+ #: grand-media.php:148
2560
+ #, php-format
2561
+ #@ gmLang
2562
+ msgid "Attention! Your server php version is: %s. Gmedia Gallery requires php version 5.2+ in order to run properly. Please upgrade your server!"
2563
+ msgstr "Attention! Votre version de PHP est serveur: %s. Gmedia Galerie nécessite la version de php 5.2+ afin de fonctionner correctement. S'il vous plaît mettre à jour votre serveur!"
2564
+
2565
+ #: grand-media.php:154
2566
+ #@ gmLang
2567
+ msgid "Attention! Your server safe mode is: ON. Gmedia Gallery requires safe mode to be OFF in order to run properly. Please set your server safe mode option!"
2568
+ msgstr "Attention! Votre mode sans échec de serveur est: ON. Galerie Gmedia nécessite que le mode sans échec soit OFF afin de fonctionner correctement. S' il vous plaît configurer votre option de serveur de mode sans échec!"
2569
+
2570
+ #: grand-media.php:258
2571
+ #@ gmLang
2572
+ msgid "Disable your Popup Blocker and try again."
2573
+ msgstr "Désactivez votre bloqueur de popup et essayer à nouveau."
2574
+
2575
+ #: grand-media.php:259
2576
+ #@ gmLang
2577
+ msgid "downloading..."
2578
+ msgstr "En téléchargement..."
2579
+
2580
+ #: grand-media.php:260
2581
+ #@ gmLang
2582
+ msgid "Working. Wait please."
2583
+ msgstr "En fonction. Veuillez attendre svp."
2584
+
2585
+ #: inc/core.php:180
2586
+ #: inc/core.php:1175
2587
+ #: inc/core.php:1295
2588
+ #: inc/core.php:1321
2589
+ #, php-format
2590
+ #@ default
2591
+ #@ gmLang
2592
+ msgid "Unable to create directory %s. Is its parent directory writable by the server?"
2593
+ msgstr "Impossible de créer le répertoire% s. Est-ce que le répertoire parent est accessible pour écriture par le serveur?"
2594
+
2595
+ #: inc/core.php:1189
2596
+ #, php-format
2597
+ #@ gmLang
2598
+ msgid "Directory %s or its subfolders are not writable by the server."
2599
+ msgstr "Le répertoire %s ou ses sous-dossiers ne sont pas accessibles en écriture par le serveur."
2600
+
2601
+ #: inc/core.php:1211
2602
+ #, php-format
2603
+ #@ gmLang
2604
+ msgid "Failed to open directory: %s"
2605
+ msgstr "Impossible d'ouvrir le répertoire: %s"
2606
+
2607
+ #: inc/core.php:1229
2608
+ #@ gmLang
2609
+ msgid "Failed to open input stream."
2610
+ msgstr "Impossible d'ouvrir le flux d'entrée."
2611
+
2612
+ #: inc/core.php:1309
2613
+ #: inc/core.php:1335
2614
+ #, php-format
2615
+ #@ gmLang
2616
+ msgid "Directory %s is not writable by the server."
2617
+ msgstr "Le répertoire %s n'est pas accessible en écriture par le serveur."
2618
+
2619
+ #: inc/core.php:1510
2620
+ #, php-format
2621
+ #@ gmLang
2622
+ msgid "File uploaded successful. Assigned ID: %s"
2623
+ msgstr "Fichier téléchargé avec succès. ID affecté: %s"
2624
+
2625
+ #: inc/core.php:1521
2626
+ #@ gmLang
2627
+ msgid "Failed to open output stream."
2628
+ msgstr "Impossible d'ouvrir le flux de sortie."
2629
+
2630
+ #: inc/db.connect.php:312
2631
+ #@ gmLang
2632
+ msgid "Page"
2633
+ msgstr ""
2634
+
2635
+ #: inc/db.connect.php:316
2636
+ #@ gmLang
2637
+ msgid "of"
2638
+ msgstr "de"
2639
+
2640
+ #: inc/db.connect.php:2094
2641
+ #@ default
2642
+ msgid "Empty Term"
2643
+ msgstr ""
2644
+
2645
+ #: inc/db.connect.php:2101
2646
+ #: inc/db.connect.php:2239
2647
+ #: inc/db.connect.php:2853
2648
+ #: inc/db.connect.php:3050
2649
+ #@ default
2650
+ msgid "Invalid Taxonomy"
2651
+ msgstr ""
2652
+
2653
+ #: inc/db.connect.php:2581
2654
+ #: inc/db.connect.php:2675
2655
+ #@ default
2656
+ msgid "Invalid taxonomy"
2657
+ msgstr ""
2658
+
2659
+ #: inc/db.connect.php:2590
2660
+ #@ default
2661
+ msgid "Invalid term ID"
2662
+ msgstr ""
2663
+
2664
+ #: inc/db.connect.php:2594
2665
+ #@ default
2666
+ msgid "A name is required for this term"
2667
+ msgstr ""
2668
+
2669
+ #: inc/db.connect.php:2614
2670
+ #@ default
2671
+ msgid "A term with the name provided already exists."
2672
+ msgstr ""
2673
+
2674
+ #: inc/db.connect.php:2618
2675
+ #@ default
2676
+ msgid "Could not insert term into the database"
2677
+ msgstr ""
2678
+
2679
+ #: inc/db.connect.php:2711
2680
+ #@ default
2681
+ msgid "A name is required for term"
2682
+ msgstr ""
2683
+
2684
+ #: inc/db.connect.php:2752
2685
+ #: inc/db.connect.php:2964
2686
+ #@ default
2687
+ msgid "Could not insert gmedia term relationship into the database"
2688
+ msgstr ""
2689
+
2690
+ #: inc/image-editor.php:19
2691
+ #@ default
2692
+ msgid "Do you really want restore original image?"
2693
+ msgstr ""
2694
+
2695
+ #: inc/image-editor.php:19
2696
+ #@ gmLang
2697
+ msgid "Restore Original"
2698
+ msgstr "Restoration de l'original"
2699
+
2700
+ #: inc/image-editor.php:22
2701
+ #@ default
2702
+ msgid "Do you really want reset all changes?"
2703
+ msgstr ""
2704
+
2705
+ #: inc/image-editor.php:22
2706
+ #@ gmLang
2707
+ msgid "Reset"
2708
+ msgstr "Réinitialiser"
2709
+
2710
+ #: inc/image-editor.php:23
2711
+ #@ gmLang
2712
+ msgid "Working"
2713
+ msgstr "En fonction"
2714
+
2715
+ #: inc/image-editor.php:23
2716
+ #@ gmLang
2717
+ msgid "Save image"
2718
+ msgstr "Sauvegarder une image"
2719
+
2720
+ #: inc/image-editor.php:28
2721
+ #@ gmLang
2722
+ msgid "Rotate Counterclockwise"
2723
+ msgstr "Rotation antihoraire"
2724
+
2725
+ #: inc/image-editor.php:29
2726
+ #@ gmLang
2727
+ msgid "Rotate Clockwise"
2728
+ msgstr "Rotation horaire"
2729
+
2730
+ #: inc/image-editor.php:30
2731
+ #@ gmLang
2732
+ msgid "Flip Horizontal"
2733
+ msgstr "Retourner horizontalement"
2734
+
2735
+ #: inc/image-editor.php:31
2736
+ #@ gmLang
2737
+ msgid "Flip Vertical"
2738
+ msgstr "Retourner verticalement"
2739
+
2740
+ #: inc/image-editor.php:32
2741
+ #@ gmLang
2742
+ msgid "Greyscale"
2743
+ msgstr "Niveaux de gris"
2744
+
2745
+ #: inc/image-editor.php:33
2746
+ #@ gmLang
2747
+ msgid "Invert"
2748
+ msgstr "Inverser"
2749
+
2750
+ #: inc/image-editor.php:45
2751
+ #@ gmLang
2752
+ msgid "Processing image"
2753
+ msgstr "L'image en cours d'execution"
2754
+
2755
+ #: inc/image-editor.php:53
2756
+ #@ gmLang
2757
+ msgid "Brightness"
2758
+ msgstr "Luminosité"
2759
+
2760
+ #: inc/image-editor.php:64
2761
+ #@ gmLang
2762
+ msgid "Contrast"
2763
+ msgstr "Contraste"
2764
+
2765
+ #: inc/image-editor.php:75
2766
+ #@ gmLang
2767
+ msgid "Saturation"
2768
+ msgstr ""
2769
+
2770
+ #: inc/image-editor.php:86
2771
+ #@ gmLang
2772
+ msgid "Vibrance"
2773
+ msgstr ""
2774
+
2775
+ #: inc/image-editor.php:97
2776
+ #@ gmLang
2777
+ msgid "Exposure"
2778
+ msgstr "Exposition"
2779
+
2780
+ #: inc/image-editor.php:108
2781
+ #@ gmLang
2782
+ msgid "Hue"
2783
+ msgstr "Teinte"
2784
+
2785
+ #: inc/image-editor.php:119
2786
+ #@ gmLang
2787
+ msgid "Sepia"
2788
+ msgstr "Sépia"
2789
+
2790
+ #: inc/image-editor.php:130
2791
+ #@ gmLang
2792
+ msgid "Noise"
2793
+ msgstr "Bruit"
2794
+
2795
+ #: inc/image-editor.php:141
2796
+ #@ gmLang
2797
+ msgid "Clip"
2798
+ msgstr "Agrafe"
2799
+
2800
+ #: inc/image-editor.php:155
2801
+ #@ gmLang
2802
+ msgid "Apply to"
2803
+ msgstr "Appliquer à"
2804
+
2805
+ #: inc/image-editor.php:157
2806
+ #@ default
2807
+ msgid "Original, Web-image, Thumbnail"
2808
+ msgstr ""
2809
+
2810
+ #: inc/image-editor.php:158
2811
+ #@ default
2812
+ msgid "Web-image, Thumbnail"
2813
+ msgstr ""
2814
+
2815
+ #: inc/image-editor.php:159
2816
+ #@ default
2817
+ msgid "Thumbnail"
2818
+ msgstr ""
2819
+
2820
+ #: inc/media-upload.php:27
2821
+ #@ gmLang
2822
+ msgid "Gmedia"
2823
+ msgstr ""
2824
+
2825
+ #: inc/media-upload.php:38
2826
+ #@ gmLang
2827
+ msgid "Gmedia Upload"
2828
+ msgstr "Téléchargement Gmedia"
2829
+
2830
+ #: inc/media-upload.php:254
2831
+ #@ gmLang
2832
+ msgid "Refresh"
2833
+ msgstr "Rafraichir"
2834
+
2835
+ #: inc/media-upload.php:365
2836
+ #@ gmLang
2837
+ msgid "Edit gallery"
2838
+ msgstr "Éditer la galerie"
2839
+
2840
+ #: inc/media-upload.php:389
2841
+ #: inc/media-upload.php:572
2842
+ #@ gmLang
2843
+ msgid "Insert into post"
2844
+ msgstr "Insérer dans un message"
2845
+
2846
+ #: inc/media-upload.php:512
2847
+ #@ gmLang
2848
+ msgid "Link To"
2849
+ msgstr "Lier à"
2850
+
2851
+ #: inc/media-upload.php:514
2852
+ #@ default
2853
+ msgid "Custom URL"
2854
+ msgstr ""
2855
+
2856
+ #: inc/media-upload.php:515
2857
+ #@ default
2858
+ msgid "Web size image"
2859
+ msgstr ""
2860
+
2861
+ #: inc/media-upload.php:516
2862
+ #@ default
2863
+ msgid "Original image"
2864
+ msgstr ""
2865
+
2866
+ #: inc/media-upload.php:540
2867
+ #@ gmLang
2868
+ msgid "Alignment"
2869
+ msgstr "Alignement"
2870
+
2871
+ #: inc/media-upload.php:543
2872
+ #@ gmLang
2873
+ msgid "Left"
2874
+ msgstr "Gauche"
2875
+
2876
+ #: inc/media-upload.php:544
2877
+ #@ gmLang
2878
+ msgid "Center"
2879
+ msgstr "Centré"
2880
+
2881
+ #: inc/media-upload.php:545
2882
+ #@ gmLang
2883
+ msgid "Right"
2884
+ msgstr "Droite"
2885
+
2886
+ #: inc/media-upload.php:574
2887
+ #@ gmLang
2888
+ msgid "Use as featured image"
2889
+ msgstr "Utiliser comme Image à la une"
2890
+
2891
+ #: inc/media-upload.php:888
2892
+ #@ gmLang
2893
+ msgid "Upload finished"
2894
+ msgstr "Téléchargement terminé"
2895
+
2896
+ #: inc/post-metabox.php:63
2897
+ #@ gmLang
2898
+ msgid "Initializing..."
2899
+ msgstr "Initialisation ..."
2900
+
2901
+ #: inc/post-metabox.php:64
2902
+ #@ gmLang
2903
+ msgid "Choose text area first"
2904
+ msgstr "Choisissez la zone de texte en premier"
2905
+
2906
+ #: inc/post-metabox.php:102
2907
+ #@ gmLang
2908
+ msgid "module"
2909
+ msgstr ""
2910
+
2911
+ #: inc/post-metabox.php:107
2912
+ #@ gmLang
2913
+ msgid "click to remove shortcode"
2914
+ msgstr "Cliquez pour supprimer un shortcode"
2915
+
2916
+ #: inc/post-metabox.php:112
2917
+ #@ gmLang
2918
+ msgid "click to insert shortcode"
2919
+ msgstr "Cliquez pour insérer un shortcode"
2920
+
2921
+ #: inc/post-metabox.php:119
2922
+ #@ gmLang
2923
+ msgid "edit"
2924
+ msgstr "Éditer"
2925
+
2926
+ #: inc/post-metabox.php:124
2927
+ #@ gmLang
2928
+ msgid "No Galleries."
2929
+ msgstr "Aucune galerie"
2930
+
2931
+ #: inc/post-metabox.php:124
2932
+ #@ gmLang
2933
+ msgid "Create"
2934
+ msgstr "Créer"
2935
+
2936
+ #: inc/post-metabox.php:131
2937
+ #@ gmLang
2938
+ msgid "Rate Gmedia at Wordpress.org"
2939
+ msgstr "Noter Gmedia sur Wordpress.org"
2940
+
2941
+ #: inc/post-metabox.php:159
2942
+ #@ gmLang
2943
+ msgid "Set GmediaGallery featured image"
2944
+ msgstr "Rég;er l'Image à la une de GmediaGallery"
2945
+
2946
+ #: inc/post-metabox.php:167
2947
+ #@ gmLang
2948
+ msgid "Replace from Gmedia Library"
2949
+ msgstr "Replacer dans la bibiothèque Gmedia"
2950
+
2951
+ #: inc/post-metabox.php:169
2952
+ #@ gmLang
2953
+ msgid "Set Gmedia featured image"
2954
+ msgstr "Régler l'Image à la une Gmedia"
2955
+
2956
+ #: inc/shortcodes.php:97
2957
+ #@ gmLang
2958
+ msgid "Gmedia Module folder missed."
2959
+ msgstr "Le dossier du module Gmedia est manquant."
2960
+
2961
+ #: inc/shortcodes.php:109
2962
+ #, php-format
2963
+ #@ default
2964
+ msgid "Module `%s` is outdated. Update module to latest version"
2965
+ msgstr ""
2966
+
2967
+ #: inc/shortcodes.php:112
2968
+ #, php-format
2969
+ #@ default
2970
+ msgid "Module `%s` is broken. Choose another module for this gallery"
2971
+ msgstr ""
2972
+
2973
+ #: inc/shortcodes.php:157
2974
+ #: inc/shortcodes.php:161
2975
+ #@ default
2976
+ msgid "Choose gallery source, please."
2977
+ msgstr ""
2978
+
2979
+ #: setup.php:38
2980
+ #@ gmLang
2981
+ msgid "Abstract"
2982
+ msgstr ""
2983
+
2984
+ #: setup.php:39
2985
+ #@ gmLang
2986
+ msgid "Animals"
2987
+ msgstr ""
2988
+
2989
+ #: setup.php:40
2990
+ #@ gmLang
2991
+ msgid "Black and White"
2992
+ msgstr ""
2993
+
2994
+ #: setup.php:41
2995
+ #@ gmLang
2996
+ msgid "Celebrities"
2997
+ msgstr ""
2998
+
2999
+ #: setup.php:42
3000
+ #@ gmLang
3001
+ msgid "City & Architecture"
3002
+ msgstr ""
3003
+
3004
+ #: setup.php:43
3005
+ #@ gmLang
3006
+ msgid "Commercial"
3007
+ msgstr ""
3008
+
3009
+ #: setup.php:44
3010
+ #@ gmLang
3011
+ msgid "Concert"
3012
+ msgstr ""
3013
+
3014
+ #: setup.php:45
3015
+ #@ gmLang
3016
+ msgid "Family"
3017
+ msgstr ""
3018
+
3019
+ #: setup.php:46
3020
+ #@ gmLang
3021
+ msgid "Fashion"
3022
+ msgstr ""
3023
+
3024
+ #: setup.php:47
3025
+ #@ gmLang
3026
+ msgid "Film"
3027
+ msgstr ""
3028
+
3029
+ #: setup.php:48
3030
+ #@ gmLang
3031
+ msgid "Fine Art"
3032
+ msgstr ""
3033
+
3034
+ #: setup.php:49
3035
+ #@ gmLang
3036
+ msgid "Food"
3037
+ msgstr ""
3038
+
3039
+ #: setup.php:50
3040
+ #@ gmLang
3041
+ msgid "Journalism"
3042
+ msgstr ""
3043
+
3044
+ #: setup.php:51
3045
+ #@ gmLang
3046
+ msgid "Landscapes"
3047
+ msgstr ""
3048
+
3049
+ #: setup.php:52
3050
+ #@ gmLang
3051
+ msgid "Macro"
3052
+ msgstr ""
3053
+
3054
+ #: setup.php:53
3055
+ #@ gmLang
3056
+ msgid "Nature"
3057
+ msgstr ""
3058
+
3059
+ #: setup.php:54
3060
+ #@ gmLang
3061
+ msgid "Nude"
3062
+ msgstr ""
3063
+
3064
+ #: setup.php:55
3065
+ #@ gmLang
3066
+ msgid "People"
3067
+ msgstr ""
3068
+
3069
+ #: setup.php:56
3070
+ #@ gmLang
3071
+ msgid "Performing Arts"
3072
+ msgstr ""
3073
+
3074
+ #: setup.php:57
3075
+ #@ gmLang
3076
+ msgid "Sport"
3077
+ msgstr ""
3078
+
3079
+ #: setup.php:58
3080
+ #@ gmLang
3081
+ msgid "Still Life"
3082
+ msgstr ""
3083
+
3084
+ #: setup.php:59
3085
+ #@ gmLang
3086
+ msgid "Street"
3087
+ msgstr ""
3088
+
3089
+ #: setup.php:60
3090
+ #@ gmLang
3091
+ msgid "Transportation"
3092
+ msgstr ""
3093
+
3094
+ #: setup.php:61
3095
+ #@ gmLang
3096
+ msgid "Travel"
3097
+ msgstr ""
3098
+
3099
+ #: setup.php:62
3100
+ #@ gmLang
3101
+ msgid "Underwater"
3102
+ msgstr ""
3103
+
3104
+ #: setup.php:63
3105
+ #@ gmLang
3106
+ msgid "Urban Exploration"
3107
+ msgstr ""
3108
+
3109
+ #: setup.php:64
3110
+ #@ gmLang
3111
+ msgid "Wedding"
3112
+ msgstr ""
3113
+
3114
+ #: setup.php:99
3115
+ #@ gmLang
3116
+ msgid "Sorry, Gmedia Gallery works only with a role called administrator"
3117
+ msgstr "Désolé, Gmedia Galerie fonctionne uniquement avec un administrateur de rôle appelé"
3118
+
3119
+ #: setup.php:225
3120
+ #@ gmLang
3121
+ msgid "GmediaGallery: Tables could not created, please check your database settings"
3122
+ msgstr "GmediaGallery: Les tables ne peuvent pas être créées, s'il vous plaît vérifier vos paramètres de base de données"
3123
+
3124
+ #: update.php:12
3125
+ #@ gmLang
3126
+ msgid "<strong>GmediaGallery Data Update Required</strong> &#8211; We need to update your install to the latest version."
3127
+ msgstr "<strong>GmediaGallery Data Update Required</strong> &#8211; Nous devons mettre à jour votre instalation à la dernière version."
3128
+
3129
+ #: update.php:14
3130
+ #@ gmLang
3131
+ msgid "<strong>Important:</strong> &#8211; GmediaGallery plugin was fully rewritten, so after update you need to check all your created galleries and update modules."
3132
+ msgstr "strong>Important:</strong> &#8211; GmediaGallery plugin a été complètement réécrit, alors après la mise à jour vous devez revérifier toutes vos galeries créées et la mise à jour de vos modules."
3133
+
3134
+ #: update.php:16
3135
+ #: update.php:35
3136
+ #@ gmLang
3137
+ msgid "The update process may take a little while, so please be patient."
3138
+ msgstr "Le processus de mise à jour peut prendre un peu de temps, donc s'il vous plaît soyez patient."
3139
+
3140
+ #: update.php:19
3141
+ #@ gmLang
3142
+ msgid "Run the updater"
3143
+ msgstr "Exécutez la mise à jour"
3144
+
3145
+ #: update.php:24
3146
+ #@ gmedia
3147
+ msgid "It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?"
3148
+ msgstr ""
3149
+
3150
+ #: update.php:33
3151
+ #@ gmLang
3152
+ msgid "<strong>GmediaGallery Updating:</strong> &#8211; GmediaGallery plugin was fully rewritten, so after update you need to check all your created galleries and update modules."
3153
+ msgstr "<strong> GmediaGallery Mise à jour: </ strong> - Le plugin GmediaGallery a été entièrement réécrit, donc après la mise à jour, vous devez vérifier toutes vos galeries créées et des modules de mise à jour."
3154
+
3155
+ #: update.php:109
3156
+ #@ gmLang
3157
+ msgid "Gmedia database tables updated..."
3158
+ msgstr "Les tables de la base de données Gmedia sont mise à jour..."
3159
+
3160
+ #: update.php:125
3161
+ #@ gmLang
3162
+ msgid "Start update images..."
3163
+ msgstr "Démarrer la mise à jour des images..."
3164
+
3165
+ #: update.php:180
3166
+ #@ gmLang
3167
+ msgid "Gmedia database data updated..."
3168
+ msgstr "La base de données Gmedia est mise à jour..."
3169
+
3170
+ #: update.php:227
3171
+ #@ gmLang
3172
+ msgid "Gmedia Galleries updated..."
3173
+ msgstr "Les galeries Gmedia sont mises à jour"
3174
+
3175
+ #: update.php:233
3176
+ #@ gmLang
3177
+ msgid "GmediaGallery plugin update complete."
3178
+ msgstr "La mise èa jour du plugin GmediaGallery est complétée"
3179
+
3180
+ #: update.php:407
3181
+ #@ gmLang
3182
+ msgid "Ignored"
3183
+ msgstr "Ignoré"
3184
+
3185
+ #: update.php:411
3186
+ #@ gmLang
3187
+ msgid "Invalid image."
3188
+ msgstr "Image invalide"
3189
+
3190
+ #: update.php:424
3191
+ #@ gmLang
3192
+ msgid "Image update process complete..."
3193
+ msgstr "Le processus de mise à jour des images est complété... "
3194
+
languages/gmLang-sr_RS.mo ADDED
Binary file
languages/gmLang-sr_RS.po ADDED
@@ -0,0 +1,2326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2014 Gmedia Gallery
2
+ # This file is distributed under the same license as the Gmedia Gallery package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Gmedia Gallery 1.2.6\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/grand-media\n"
7
+ "POT-Creation-Date: 2014-09-22 12:06:48+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: 2014-10-08 11:20+0100\n"
12
+ "Last-Translator: Borisa Djuraskovic <borisad@webhostinghub.com>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "X-Generator: Poedit 1.5.7\n"
15
+
16
+ #: access.php:196 admin/addmedia.php:124 admin/addmedia.php:345
17
+ #: admin/ajax.php:517 admin/ajax.php:535 admin/ajax.php:1025
18
+ #: admin/gmedia.php:391 admin/gmedia.php:507 admin/gmedia.php:657
19
+ msgid "Uncategorized"
20
+ msgstr "Nekategorisan"
21
+
22
+ #: access.php:228 admin/terms.php:222 admin/terms.php:758
23
+ msgid "Shared"
24
+ msgstr "Podeljen"
25
+
26
+ #: access.php:308 admin/upload.php:56
27
+ msgid "Failed to move uploaded file."
28
+ msgstr "Neuspeo prenos otpremljene datoteke"
29
+
30
+ #: access.php:355 admin/processor.php:389 admin/processor.php:404
31
+ msgid "You are not allowed to edit media"
32
+ msgstr "Nije vam dozvoljeno da uređujete medije"
33
+
34
+ #: access.php:363 admin/galleries.php:372 admin/gmedia.php:311
35
+ #: admin/processor.php:168 admin/processor.php:208 admin/processor.php:264
36
+ #: admin/processor.php:292 admin/processor.php:320 admin/processor.php:599
37
+ #: admin/processor.php:693
38
+ msgid "You are not allowed to edit others media"
39
+ msgstr "Nije vam dozvoljeno da uređujete tuđe medije"
40
+
41
+ #: access.php:403
42
+ msgid "You are not allowed to manage categories"
43
+ msgstr "Nije vam dozvoljeno da upravljate kategorijama"
44
+
45
+ #: access.php:415
46
+ msgid "%d items updated with \"Uncategorized\""
47
+ msgstr "%d stavki ažurirano sa \"Nekategorisan\""
48
+
49
+ #: access.php:428 admin/processor.php:192
50
+ msgid "Category `%s` assigned to %d images."
51
+ msgstr "Kategorija `%s` dodeljena %d slikama"
52
+
53
+ #: access.php:430 admin/processor.php:194
54
+ msgid "Category `%s` can't be assigned."
55
+ msgstr "Kategorija`%s` ne može biti dodeljena"
56
+
57
+ #: access.php:437 admin/processor.php:505
58
+ msgid "You are not allowed to manage albums"
59
+ msgstr "Nije vam dozvoljeno da uređujete albume"
60
+
61
+ #: access.php:445 admin/processor.php:219
62
+ msgid "%d items updated with \"No Album\""
63
+ msgstr "%d stavki ažurirano sa \"Nema albuma\""
64
+
65
+ #: access.php:461 admin/processor.php:249
66
+ msgid "Album `%s` assigned to %d items"
67
+ msgstr "Album `%s`dodeljen %d stavkama"
68
+
69
+ #: access.php:467
70
+ msgid "You are not allowed manage tags"
71
+ msgstr "Nije vam dozvoljeno da upravljate oznakama"
72
+
73
+ #: access.php:471 access.php:494
74
+ msgid "No tags provided"
75
+ msgstr "Nisu priložene oznake"
76
+
77
+ #: access.php:485 admin/processor.php:280
78
+ msgid "%d tags added to %d items"
79
+ msgstr "%d oznake dodate %d stavkama"
80
+
81
+ #: access.php:490 admin/processor.php:420 admin/processor.php:476
82
+ #: admin/processor.php:737
83
+ msgid "You are not allowed to delete others media"
84
+ msgstr "Nije vam dozvoljeno da brišete tuđe medije"
85
+
86
+ #: access.php:508 admin/processor.php:308
87
+ msgid "%d tags deleted from %d items"
88
+ msgstr "%d oznake obrisane sa %d stavki"
89
+
90
+ #: access.php:514 access.php:646
91
+ msgid "You are not allowed to delete this post."
92
+ msgstr "Nije vam dozvoljeno da obrišete ovaj post"
93
+
94
+ #: access.php:521
95
+ msgid "You are not allowed to delete media others media"
96
+ msgstr "Nije vam dozvoljeno da brišete tuđe medije"
97
+
98
+ #: access.php:525 admin/processor.php:428
99
+ msgid "Error in deleting..."
100
+ msgstr "Greška u brisanju..."
101
+
102
+ #: access.php:530 access.php:658 admin/processor.php:489
103
+ #: admin/processor.php:749
104
+ msgid "%d items deleted successfuly"
105
+ msgstr "%d stavke uspešno obrisane"
106
+
107
+ #: access.php:676 admin/processor.php:511
108
+ msgid "Term Name is not specified"
109
+ msgstr "Naziv termina nije određen"
110
+
111
+ #: access.php:680 admin/processor.php:515 admin/processor.php:564
112
+ msgid "Term Name can't be only digits"
113
+ msgstr "Naziv termina ne može se sastojati samo od cifara"
114
+
115
+ #: access.php:684 access.php:736 admin/ajax.php:919 admin/processor.php:520
116
+ #: admin/processor.php:622 admin/processor.php:687
117
+ msgid "A term with the id provided do not exists"
118
+ msgstr "Ne postoji termin koji ima dati ID"
119
+
120
+ #: access.php:689 access.php:733 admin/ajax.php:916 admin/processor.php:116
121
+ #: admin/processor.php:525 admin/processor.php:627
122
+ msgid "A term with the name provided already exists"
123
+ msgstr "Termin sa datim imenom već postoji"
124
+
125
+ #: access.php:715 admin/processor.php:551
126
+ msgid "Album `%s` successfuly saved"
127
+ msgstr "Album`%s` uspešno sačuvan"
128
+
129
+ #: access.php:730
130
+ msgid "Tag %d successfuly updated"
131
+ msgstr "Oznaka %d uspešno ažurirana"
132
+
133
+ #: access.php:739 admin/ajax.php:922
134
+ msgid "Term name can't be only digits or empty"
135
+ msgstr ""
136
+ "Naziv termina ne može se sastojati samo od cifara i ne može biti prazan"
137
+
138
+ #: access.php:755 admin/processor.php:573
139
+ msgid "%d of %d tags successfuly added"
140
+ msgstr "%d od %d oznaka uspešno dodat"
141
+
142
+ #: access.php:758 admin/processor.php:576
143
+ msgid "Some of provided tags are already exists"
144
+ msgstr "Neke od priloženih oznaka već postoje "
145
+
146
+ #: admin/addmedia.php:21
147
+ msgid "Upload Files"
148
+ msgstr "Otpremi datoteke"
149
+
150
+ #: admin/addmedia.php:23 admin/addmedia.php:487 admin/addmedia.php:519
151
+ #: admin/addmedia.php:536 admin/ajax.php:1115
152
+ msgid "Import"
153
+ msgstr "Uvezi"
154
+
155
+ #: admin/addmedia.php:30
156
+ msgid "Add files to the upload queue and click the start button"
157
+ msgstr "Dodajte datoteke redu za otpremanje i kliknite na taster ’start’"
158
+
159
+ #: admin/addmedia.php:33
160
+ msgid "Grab files from other sources"
161
+ msgstr "Uzmi datoteke iz drugih izvora"
162
+
163
+ #: admin/addmedia.php:63
164
+ msgid "You do not have permissions to upload media"
165
+ msgstr "Nemate dozvolu za otpremanje medija"
166
+
167
+ #: admin/addmedia.php:79
168
+ msgid "Maximum file size"
169
+ msgstr "Maksimalna veličina datoteke"
170
+
171
+ #: admin/addmedia.php:82
172
+ msgid "Maximum $_POST size"
173
+ msgstr "Maksimalna veličina za $_POST "
174
+
175
+ #: admin/addmedia.php:83
176
+ msgid "Chunk size"
177
+ msgstr "Veličina bloka"
178
+
179
+ #: admin/addmedia.php:88 admin/admin.php:409 admin/admin.php:446
180
+ #: admin/ajax.php:808 admin/gmedia.php:604 admin/gmedia.php:605
181
+ #: admin/wpmedia.php:195 inc/media-upload.php:154 inc/media-upload.php:155
182
+ msgid "Title"
183
+ msgstr "Naslov"
184
+
185
+ #: admin/addmedia.php:90
186
+ msgid "EXIF or File Name"
187
+ msgstr "EXIF ili naziv datoteke"
188
+
189
+ #: admin/addmedia.php:91
190
+ msgid "File Name"
191
+ msgstr "Naziv datoteke"
192
+
193
+ #: admin/addmedia.php:92
194
+ msgid "Empty"
195
+ msgstr "Prazan"
196
+
197
+ #: admin/addmedia.php:96 admin/ajax.php:837 admin/galleries.php:202
198
+ #: admin/galleries.php:534 admin/gmedia.php:412 admin/gmedia.php:528
199
+ #: admin/gmedia.php:740 admin/terms.php:210 admin/terms.php:739
200
+ msgid "Status"
201
+ msgstr "Status"
202
+
203
+ #: admin/addmedia.php:98
204
+ msgid "Same as Album or Public"
205
+ msgstr "Isti kao album ili javan"
206
+
207
+ #: admin/addmedia.php:99 admin/ajax.php:840 admin/galleries.php:536
208
+ #: admin/gmedia.php:742 admin/terms.php:212 admin/terms.php:742
209
+ msgid "Public"
210
+ msgstr "Javan"
211
+
212
+ #: admin/addmedia.php:100 admin/ajax.php:841 admin/gmedia.php:743
213
+ #: admin/terms.php:213 admin/terms.php:744
214
+ msgid "Private"
215
+ msgstr "Privatan"
216
+
217
+ #: admin/addmedia.php:101 admin/ajax.php:842 admin/gmedia.php:744
218
+ #: admin/terms.php:214 admin/terms.php:746
219
+ msgid "Draft"
220
+ msgstr "Skica"
221
+
222
+ #: admin/addmedia.php:120 admin/addmedia.php:341 admin/ajax.php:383
223
+ #: admin/ajax.php:1021
224
+ msgid "Assign Category"
225
+ msgstr "Dodeli kategoriju"
226
+
227
+ #: admin/addmedia.php:121 admin/addmedia.php:342 admin/ajax.php:1022
228
+ msgid "(for images only)"
229
+ msgstr "(samo za slike)"
230
+
231
+ #: admin/addmedia.php:136 admin/addmedia.php:357 admin/ajax.php:1038
232
+ msgid " (shared)"
233
+ msgstr "(deljeni)"
234
+
235
+ #: admin/addmedia.php:140 admin/addmedia.php:361 admin/ajax.php:1042
236
+ msgid "Add to Album"
237
+ msgstr "Dodaj albumu"
238
+
239
+ #: admin/addmedia.php:141 admin/addmedia.php:362 admin/ajax.php:613
240
+ #: admin/ajax.php:1043 admin/gmedia.php:699
241
+ msgid "Album Name..."
242
+ msgstr "Naziv albuma..."
243
+
244
+ #: admin/addmedia.php:151 admin/addmedia.php:372 admin/ajax.php:405
245
+ #: admin/ajax.php:1054
246
+ msgid "Add Tags"
247
+ msgstr "Dodaj oznake"
248
+
249
+ #: admin/addmedia.php:152 admin/addmedia.php:373 admin/ajax.php:712
250
+ #: admin/ajax.php:1055 admin/gmedia.php:240
251
+ msgid "Add Tags..."
252
+ msgstr "Dodaj oznake..."
253
+
254
+ #: admin/addmedia.php:155 admin/addmedia.php:376 admin/ajax.php:1058
255
+ #: admin/processor.php:199 admin/processor.php:255 admin/processor.php:283
256
+ #: admin/processor.php:311
257
+ msgid "You are not allowed to assign terms"
258
+ msgstr "Nije vam dozvoljeno da dodeljujete termine"
259
+
260
+ #: admin/addmedia.php:208
261
+ msgid ""
262
+ "You browser doesn't have Flash or HTML5 support. Check also if page have no "
263
+ "JavaScript errors."
264
+ msgstr ""
265
+ "Vaš pretraživač nema Flash ili HTML5 podršku. Proverite da stranica nema "
266
+ "JavaScript greške. "
267
+
268
+ #: admin/addmedia.php:315
269
+ msgid "You do not have permissions to import media"
270
+ msgstr "Nemate dozvole za uvoz medija"
271
+
272
+ #: admin/addmedia.php:422 admin/import.php:292
273
+ msgid "Import Server Folder"
274
+ msgstr "Uvezi folder servera"
275
+
276
+ #: admin/addmedia.php:424
277
+ msgid "FlAGallery plugin"
278
+ msgstr "FlAGallery plugin"
279
+
280
+ #: admin/addmedia.php:429
281
+ msgid "NextGen plugin"
282
+ msgstr "NextGen plugin"
283
+
284
+ #: admin/addmedia.php:439
285
+ msgid "Sever folders"
286
+ msgstr "Folderi servera"
287
+
288
+ #: admin/addmedia.php:444
289
+ msgid "delete source files after importing"
290
+ msgstr "obriši datoteke izvora nakon uvoza"
291
+
292
+ #: admin/addmedia.php:446
293
+ msgid "Import folder"
294
+ msgstr "Uvezi folder"
295
+
296
+ #: admin/addmedia.php:454
297
+ msgid "loading..."
298
+ msgstr "učitavanje..."
299
+
300
+ #: admin/addmedia.php:470 admin/addmedia.php:502
301
+ msgid "If Album is not specified, then gallery name will be used as Album"
302
+ msgstr "Ako album nije određen, naziv galerije biće upotrebljen i za album"
303
+
304
+ #: admin/addmedia.php:471 admin/addmedia.php:503
305
+ msgid "Flagallery Galleries"
306
+ msgstr "Flagallery galerije"
307
+
308
+ #: admin/addmedia.php:472 admin/addmedia.php:504
309
+ msgid "Toggle checkboxes"
310
+ msgstr "Toggle polja za štikliranje"
311
+
312
+ #: admin/addmedia.php:490 admin/addmedia.php:522
313
+ msgid "There are no created galleries in this plugin."
314
+ msgstr "U ovom plugin-u nema kreiranih galerija"
315
+
316
+ #: admin/addmedia.php:549 admin/ajax.php:1115 admin/gmedia.php:310
317
+ #: admin/terms.php:255 admin/terms.php:387
318
+ msgid "Close"
319
+ msgstr "Zatvori"
320
+
321
+ #: admin/addmedia.php:549 admin/ajax.php:1115
322
+ msgid "Working..."
323
+ msgstr "Rad u toku..."
324
+
325
+ #: admin/admin.php:75 admin/admin.php:79 admin/settings.php:63
326
+ msgid "Gmedia Library"
327
+ msgstr "Gmedia Biblioteka "
328
+
329
+ #: admin/admin.php:84
330
+ msgid "Add Media Files"
331
+ msgstr "Dodaj datoteke medija"
332
+
333
+ #: admin/admin.php:84
334
+ msgid "Add/Import Files"
335
+ msgstr "Dodaj/Uvezi datoteke"
336
+
337
+ #: admin/admin.php:88 admin/settings.php:119
338
+ msgid "Albums, Tags..."
339
+ msgstr "Albumi, oznake..."
340
+
341
+ #: admin/admin.php:92 inc/post-metabox.php:87
342
+ msgid "Gmedia Galleries"
343
+ msgstr "Gmedia galerije"
344
+
345
+ #: admin/admin.php:92
346
+ msgid "Create/Manage Galleries..."
347
+ msgstr "Kreiraj galerije/Upravljaj galerijama"
348
+
349
+ #: admin/admin.php:96 admin/settings.php:153
350
+ msgid "Modules"
351
+ msgstr "Moduli"
352
+
353
+ #: admin/admin.php:100
354
+ msgid "Gmedia Settings"
355
+ msgstr "Gmedia Podešavanja"
356
+
357
+ #: admin/admin.php:100 admin/admin.php:391 admin/settings.php:160
358
+ msgid "Settings"
359
+ msgstr "Podešavanja"
360
+
361
+ #: admin/admin.php:104
362
+ msgid "Wordpress Media Library"
363
+ msgstr "Wordpress biblioteka medija"
364
+
365
+ #: admin/admin.php:104
366
+ msgid "WP Media Library"
367
+ msgstr "WP biblioteka medija"
368
+
369
+ #: admin/admin.php:135
370
+ msgid "Updating GmediaGallery Plugin"
371
+ msgstr "Ažuriranje GmediaGallery Plugin-a"
372
+
373
+ #: admin/admin.php:362
374
+ msgid "Support"
375
+ msgstr "Podrška"
376
+
377
+ #: admin/admin.php:370
378
+ msgid "Support Forum"
379
+ msgstr "Forum za podršku"
380
+
381
+ #: admin/admin.php:371
382
+ msgid "Contact"
383
+ msgstr "Kontakt"
384
+
385
+ #: admin/admin.php:372
386
+ msgid "Demo"
387
+ msgstr "Demo"
388
+
389
+ #: admin/admin.php:373
390
+ msgid "Premium"
391
+ msgstr "Premium"
392
+
393
+ #: admin/admin.php:393
394
+ msgid "Apply"
395
+ msgstr "Primeni"
396
+
397
+ #: admin/admin.php:404 admin/admin.php:441
398
+ msgid "items per page"
399
+ msgstr "stavke po stranici"
400
+
401
+ #: admin/admin.php:408 admin/admin.php:445 admin/gmedia.php:767
402
+ #: admin/terms.php:689 admin/wpmedia.php:183
403
+ msgid "ID"
404
+ msgstr "ID"
405
+
406
+ #: admin/admin.php:410 admin/admin.php:447 admin/gmedia.php:431
407
+ #: admin/gmedia.php:547 admin/gmedia.php:731
408
+ msgid "Date"
409
+ msgstr "Datum"
410
+
411
+ #: admin/admin.php:411 admin/admin.php:448
412
+ msgid "Last Modified"
413
+ msgstr "Poslednja izmena"
414
+
415
+ #: admin/admin.php:412 admin/admin.php:449
416
+ msgid "MIME Type"
417
+ msgstr "MIME tip"
418
+
419
+ #: admin/admin.php:413 admin/admin.php:450 admin/ajax.php:849
420
+ #: admin/galleries.php:186 admin/gmedia.php:428 admin/gmedia.php:544
421
+ #: admin/gmedia.php:750 admin/terms.php:219 admin/terms.php:755
422
+ msgid "Author"
423
+ msgstr "Autor"
424
+
425
+ #: admin/admin.php:414 admin/admin.php:451
426
+ msgid "order items"
427
+ msgstr "Redosled stavki"
428
+
429
+ #: admin/admin.php:418 admin/admin.php:455 admin/terms.php:204
430
+ #: admin/terms.php:732
431
+ msgid "DESC"
432
+ msgstr "DESC"
433
+
434
+ #: admin/admin.php:419 admin/admin.php:456 admin/terms.php:203
435
+ #: admin/terms.php:730
436
+ msgid "ASC"
437
+ msgstr "ASC"
438
+
439
+ #: admin/admin.php:420 admin/admin.php:457
440
+ msgid "sort order"
441
+ msgstr "redosled sortiranja"
442
+
443
+ #: admin/admin.php:427 admin/admin.php:479 admin/admin.php:485
444
+ msgid "FALSE"
445
+ msgstr "LAŽ"
446
+
447
+ #: admin/admin.php:428 admin/admin.php:478 admin/admin.php:484
448
+ msgid "TRUE"
449
+ msgstr "ISTINA"
450
+
451
+ #: admin/admin.php:429
452
+ msgid "Quick Tags panel for Description field"
453
+ msgstr "Panel za brze oznake polja ‘Opis’"
454
+
455
+ #: admin/admin.php:438
456
+ msgid "Set query options for this page to be loaded by default."
457
+ msgstr ""
458
+ "Podesite opcije pretrage za ovu stranicu koje će se učitavati po standardu."
459
+
460
+ #: admin/admin.php:468
461
+ msgid "Uploader runtime:"
462
+ msgstr "Uploader runtime:"
463
+
464
+ #: admin/admin.php:470
465
+ msgid "Auto"
466
+ msgstr "Auto"
467
+
468
+ #: admin/admin.php:471
469
+ msgid "HTML5 Uploader"
470
+ msgstr "HTML5 Uploader"
471
+
472
+ #: admin/admin.php:472
473
+ msgid "Flash Uploader"
474
+ msgstr "Flash Uploader"
475
+
476
+ #: admin/admin.php:473
477
+ msgid "HTML4 Uploader"
478
+ msgstr "HTML4 Uploader"
479
+
480
+ #: admin/admin.php:476
481
+ msgid "Chunking:"
482
+ msgstr "Chunking:"
483
+
484
+ #: admin/admin.php:482
485
+ msgid "URL streem upload:"
486
+ msgstr "URL stream otpremanje:"
487
+
488
+ #: admin/ajax.php:233
489
+ msgid "Image \"%d\" updated"
490
+ msgstr "Slika \"%d\" ažurirana"
491
+
492
+ #: admin/ajax.php:342
493
+ msgid "Image \"%d\" restored from backup and saved"
494
+ msgstr "Slika \"%d\" vraćena iz rezervne kopije i sačuvana"
495
+
496
+ #: admin/ajax.php:371
497
+ msgid "Quick Gallery from selected items"
498
+ msgstr "Quick Gallery od odabranih stavki"
499
+
500
+ #: admin/ajax.php:372
501
+ msgid "Create Quick Gallery"
502
+ msgstr "Kreiraj Quick Gallery"
503
+
504
+ #: admin/ajax.php:375
505
+ msgid "Show Images from Categories"
506
+ msgstr "Prikaži slike iz kategorija"
507
+
508
+ #: admin/ajax.php:376 admin/ajax.php:387 admin/ajax.php:398 admin/ajax.php:418
509
+ msgid "Show Selected"
510
+ msgstr "Prikaži odabrane"
511
+
512
+ #: admin/ajax.php:382
513
+ msgid "Assign Category for Selected Images"
514
+ msgstr "Dodeli kategoriju odabranim slikama"
515
+
516
+ #: admin/ajax.php:386
517
+ msgid "Filter Albums"
518
+ msgstr "Filtriraj albume"
519
+
520
+ #: admin/ajax.php:393
521
+ msgid "Assign Album for Selected Items"
522
+ msgstr "Dodeli album odabranim stavkama"
523
+
524
+ #: admin/ajax.php:394
525
+ msgid "Assign Album"
526
+ msgstr "Dodeli album"
527
+
528
+ #: admin/ajax.php:397
529
+ msgid "Filter by Tags"
530
+ msgstr "Filtriraj po oznakama"
531
+
532
+ #: admin/ajax.php:404
533
+ msgid "Add Tags to Selected Items"
534
+ msgstr "Dodaj oznake odabranim stavkama"
535
+
536
+ #: admin/ajax.php:412
537
+ msgid "Delete Tags from Selected Items"
538
+ msgstr "Obriši oznake iz odabranih stavki"
539
+
540
+ #: admin/ajax.php:413
541
+ msgid "Delete Tags"
542
+ msgstr "Obriši oznake"
543
+
544
+ #: admin/ajax.php:416
545
+ msgid "Filter by Author"
546
+ msgstr "Filtriraj na osnovu autora"
547
+
548
+ #: admin/ajax.php:427 admin/gmedia.php:215
549
+ msgid "Batch Edit"
550
+ msgstr "Uredi grupu"
551
+
552
+ #: admin/ajax.php:428
553
+ msgid "Batch Save"
554
+ msgstr "Sačuvaj grupu"
555
+
556
+ #: admin/ajax.php:449
557
+ msgid "No selected Gmedia. Select at least one item in library."
558
+ msgstr "Gmedia nije selektovana. Odaberite bar jednu stavku u galeriji."
559
+
560
+ #: admin/ajax.php:477 admin/ajax.php:478 admin/galleries.php:530
561
+ #: admin/galleries.php:531
562
+ msgid "Gallery Name"
563
+ msgstr "Naziv galerije"
564
+
565
+ #: admin/ajax.php:481
566
+ msgid "Modue"
567
+ msgstr "Modul"
568
+
569
+ #: admin/ajax.php:509
570
+ msgid "Selected IDs"
571
+ msgstr "Odabrani ID"
572
+
573
+ #: admin/ajax.php:553 admin/ajax.php:615
574
+ msgid "No Album"
575
+ msgstr "Nema albuma"
576
+
577
+ #: admin/ajax.php:560 admin/ajax.php:599 admin/gmedia.php:679
578
+ #: admin/terms.php:274
579
+ msgid "by %s"
580
+ msgstr "od %s"
581
+
582
+ #: admin/ajax.php:563 admin/ajax.php:602 admin/gmedia.php:682
583
+ #: admin/terms.php:283
584
+ msgid "shared"
585
+ msgstr "podeljen"
586
+
587
+ #: admin/ajax.php:612
588
+ msgid "Move to Album"
589
+ msgstr "Pređi na album"
590
+
591
+ #: admin/ajax.php:620
592
+ msgid "Make status of selected items be the same as Album status"
593
+ msgstr "Neka status odabranih stavki bude izjednačen sa statusom albuma"
594
+
595
+ #: admin/ajax.php:671
596
+ msgid "Filter Tags..."
597
+ msgstr "Filtriraj oznake..."
598
+
599
+ #: admin/ajax.php:702 admin/ajax.php:753 admin/ajax.php:773
600
+ msgid "No tags"
601
+ msgstr "Nema oznaka"
602
+
603
+ #: admin/ajax.php:781
604
+ msgid "Choose Author"
605
+ msgstr "Izaberite autora"
606
+
607
+ #: admin/ajax.php:800
608
+ msgid "You are not allowed to see others media"
609
+ msgstr "Nije vam dozvoljeno da vidite tuđe medije"
610
+
611
+ #: admin/ajax.php:806
612
+ msgid "Note, data will be saved to all selected items in Gmedia Library."
613
+ msgstr ""
614
+ "Zapamtite, podaci će biti sačuvani u svim odabranim stavkama u Gmedia "
615
+ "biblioteci."
616
+
617
+ #: admin/ajax.php:810 admin/ajax.php:820 admin/ajax.php:829 admin/ajax.php:839
618
+ #: admin/ajax.php:851
619
+ msgid "Skip. Do not change"
620
+ msgstr "Preskoči. Nemoj da menjaš"
621
+
622
+ #: admin/ajax.php:811
623
+ msgid "Empty Title"
624
+ msgstr "Prazan naslov"
625
+
626
+ #: admin/ajax.php:812
627
+ msgid "From Filename"
628
+ msgstr "Iz naziva datoteke"
629
+
630
+ #: admin/ajax.php:813 admin/ajax.php:822 admin/ajax.php:832
631
+ msgid "Custom"
632
+ msgstr "Prilagođeni"
633
+
634
+ #: admin/ajax.php:815
635
+ msgid "Enter custom title here"
636
+ msgstr "Ovde unesite prilagođeni naslov"
637
+
638
+ #: admin/ajax.php:818 admin/galleries.php:636 admin/gmedia.php:614
639
+ #: admin/terms.php:182 admin/terms.php:702 admin/wpmedia.php:197
640
+ #: inc/media-upload.php:169
641
+ msgid "Description"
642
+ msgstr "Opis"
643
+
644
+ #: admin/ajax.php:821
645
+ msgid "Empty Description"
646
+ msgstr "Prazan opis"
647
+
648
+ #: admin/ajax.php:824
649
+ msgid "Enter description here"
650
+ msgstr "Ovde unesite opis"
651
+
652
+ #: admin/ajax.php:827 admin/gmedia.php:434 admin/gmedia.php:550
653
+ msgid "Link"
654
+ msgstr "Link"
655
+
656
+ #: admin/ajax.php:830
657
+ msgid "Empty Link"
658
+ msgstr "Prazan link"
659
+
660
+ #: admin/ajax.php:831
661
+ msgid "Link to original file"
662
+ msgstr "Link za originalnu datoteku"
663
+
664
+ #: admin/ajax.php:834
665
+ msgid "Enter url here"
666
+ msgstr "Ovde unesite url"
667
+
668
+ #: admin/ajax.php:875
669
+ msgid "Ops! Something wrong."
670
+ msgstr "Ups! Nešto nije u redu."
671
+
672
+ #: admin/ajax.php:881 admin/ajax.php:1114 admin/galleries.php:310
673
+ #: admin/galleries.php:912 admin/modules.php:193
674
+ msgid "Cancel"
675
+ msgstr "Otkaži"
676
+
677
+ #: admin/ajax.php:913
678
+ msgid "Tag #%d successfuly updated"
679
+ msgstr "Oznaka #%d uspešno ažurirana"
680
+
681
+ #: admin/ajax.php:938
682
+ msgid "You are not allowed to install modules"
683
+ msgstr "Nije vam dozvoljeno da instalirate module"
684
+
685
+ #: admin/ajax.php:960 admin/processor.php:782
686
+ msgid "Could not access filesystem."
687
+ msgstr "Nije bio moguć pristup sistemu datoteka"
688
+
689
+ #: admin/ajax.php:962 admin/processor.php:784
690
+ msgid "Filesystem error"
691
+ msgstr "Greška u sistemu datoteka"
692
+
693
+ #: admin/ajax.php:974
694
+ msgid "The `%s` module successfuly installed"
695
+ msgstr "Modul`%s`uspešno instaliran"
696
+
697
+ #: admin/ajax.php:977 admin/processor.php:797
698
+ msgid "No file specified"
699
+ msgstr "Nije navedena nijedna datoteka"
700
+
701
+ #: admin/ajax.php:998 admin/import.php:412
702
+ msgid "Import from WP Media Library"
703
+ msgstr "Uvezi iz WP biblioteke medija"
704
+
705
+ #: admin/ajax.php:1175
706
+ msgid "No items related by tags."
707
+ msgstr "Nema stavki povezanih sa ovom oznakom."
708
+
709
+ #: admin/ajax.php:1209
710
+ msgid "No items matching the search query."
711
+ msgstr "Nema stavki koje se podudaraju sa upitom pretrage."
712
+
713
+ #: admin/ajax.php:1211
714
+ msgid "No items to show"
715
+ msgstr "Nema stavki za prikazivanje"
716
+
717
+ #: admin/galleries.php:78 admin/gmedia.php:90 admin/terms.php:80
718
+ #: admin/wpmedia.php:50 inc/media-upload.php:113
719
+ msgid "Search..."
720
+ msgstr "Traži..."
721
+
722
+ #: admin/galleries.php:89 admin/galleries.php:107 admin/galleries.php:125
723
+ #: admin/gmedia.php:101 admin/gmedia.php:124 admin/gmedia.php:200
724
+ #: admin/gmedia.php:280 admin/terms.php:96 admin/terms.php:123
725
+ #: admin/terms.php:153 admin/terms.php:662 admin/wpmedia.php:63
726
+ #: admin/wpmedia.php:88 admin/wpmedia.php:136 admin/wpmedia.php:158
727
+ msgid "Toggle Dropdown"
728
+ msgstr "Toggle opadajući"
729
+
730
+ #: admin/galleries.php:92 admin/gmedia.php:103 admin/gmedia.php:138
731
+ #: admin/terms.php:99 admin/wpmedia.php:65 admin/wpmedia.php:95
732
+ msgid "All"
733
+ msgstr "Svi"
734
+
735
+ #: admin/galleries.php:93 admin/gmedia.php:104 admin/terms.php:100
736
+ #: admin/wpmedia.php:66 inc/media-upload.php:188
737
+ msgid "None"
738
+ msgstr "Nijedan"
739
+
740
+ #: admin/galleries.php:95 admin/gmedia.php:110 admin/terms.php:103
741
+ #: admin/wpmedia.php:73
742
+ msgid "Reverse only visible items"
743
+ msgstr "Okreni samo vidljive stavke"
744
+
745
+ #: admin/galleries.php:95 admin/gmedia.php:110 admin/terms.php:103
746
+ #: admin/wpmedia.php:73
747
+ msgid "Reverse"
748
+ msgstr "Okreni"
749
+
750
+ #: admin/galleries.php:100 admin/modules.php:125 inc/post-metabox.php:87
751
+ msgid "Create Gallery"
752
+ msgstr "Kreiraj galeriju"
753
+
754
+ #: admin/galleries.php:104 admin/gmedia.php:195 admin/gmedia.php:197
755
+ #: admin/terms.php:120 admin/terms.php:659 admin/wpmedia.php:133
756
+ msgid "Action"
757
+ msgstr "Aktivnost"
758
+
759
+ #: admin/galleries.php:114 admin/gmedia.php:263 admin/terms.php:131
760
+ #: admin/wpmedia.php:149
761
+ msgid "Select items to see more actions"
762
+ msgstr "Odaberite artikle da biste videli više "
763
+
764
+ #: admin/galleries.php:116 admin/gmedia.php:252 admin/terms.php:138
765
+ msgid ""
766
+ "You are about to permanently delete the selected items.\n"
767
+ "\r'Cancel' to stop, 'OK' to delete."
768
+ msgstr ""
769
+ "Pripremate se da trajno obrišete odabrane stavke. Kliknite na ‘Otkaži’ da "
770
+ "biste obustavili brisanje ili na ‘OK’ da biste nastavili."
771
+
772
+ #: admin/galleries.php:116 admin/gmedia.php:252 admin/terms.php:138
773
+ msgid "Delete Selected Items"
774
+ msgstr "Obriši odabrane stavke"
775
+
776
+ #: admin/galleries.php:123 admin/gmedia.php:278 admin/terms.php:150
777
+ #: admin/wpmedia.php:155
778
+ msgid "%s selected"
779
+ msgstr "%s odabrane"
780
+
781
+ #: admin/galleries.php:128 admin/gmedia.php:285 admin/terms.php:158
782
+ #: admin/wpmedia.php:161
783
+ msgid "Show only selected items"
784
+ msgstr "Prikaži samo odabrane stavke"
785
+
786
+ #: admin/galleries.php:129 admin/gmedia.php:290 admin/terms.php:160
787
+ #: admin/wpmedia.php:162
788
+ msgid "Clear selected items"
789
+ msgstr "Obriši odabrane stavke"
790
+
791
+ #: admin/galleries.php:172
792
+ msgid "Module broken <br>Reinstall module"
793
+ msgstr "Modul ne radi <br> Ponovo instaliraj modul"
794
+
795
+ #: admin/galleries.php:192 admin/galleries.php:193
796
+ msgid "Shortcode"
797
+ msgstr "Shortcode"
798
+
799
+ #: admin/galleries.php:199
800
+ msgid "Module"
801
+ msgstr "Modul"
802
+
803
+ #: admin/galleries.php:200 admin/gmedia.php:415 admin/gmedia.php:531
804
+ #: admin/gmedia.php:768 admin/wpmedia.php:192
805
+ msgid "Type"
806
+ msgstr "Tip"
807
+
808
+ #: admin/galleries.php:201 admin/gmedia.php:778
809
+ msgid "Last Edited"
810
+ msgstr "Poslednji put uređeno"
811
+
812
+ #: admin/galleries.php:203
813
+ msgid "Source"
814
+ msgstr "Izvor"
815
+
816
+ #: admin/galleries.php:208 admin/galleries.php:554
817
+ msgid "Selected Gmedia"
818
+ msgstr "Odabrani Gmedia"
819
+
820
+ #: admin/galleries.php:210
821
+ msgid "Show %d items in Gmedia Library"
822
+ msgstr "Prikaži %d stavke u Gmedia biblioteci"
823
+
824
+ #: admin/galleries.php:216 admin/galleries.php:552 admin/gmedia.php:172
825
+ #: admin/terms.php:115 admin/terms.php:655
826
+ msgid "Categories"
827
+ msgstr "Kategorije"
828
+
829
+ #: admin/galleries.php:221 admin/galleries.php:550 admin/gmedia.php:176
830
+ #: admin/terms.php:111 admin/terms.php:651
831
+ msgid "Albums"
832
+ msgstr "Albumi"
833
+
834
+ #: admin/galleries.php:226 admin/galleries.php:551 admin/gmedia.php:179
835
+ #: admin/gmedia.php:395 admin/gmedia.php:511 admin/import.php:266
836
+ #: admin/terms.php:113 admin/terms.php:366 admin/terms.php:653
837
+ msgid "Tags"
838
+ msgstr "Oznake"
839
+
840
+ #: admin/galleries.php:231 inc/image-editor.php:50
841
+ msgid "Filters"
842
+ msgstr "Filteri"
843
+
844
+ #: admin/galleries.php:250 admin/gmedia.php:845 admin/terms.php:349
845
+ #: admin/terms.php:524 admin/wpmedia.php:234 inc/media-upload.php:202
846
+ msgid "No items to show."
847
+ msgstr "Nema stavki za prikazivanje"
848
+
849
+ #: admin/galleries.php:267 admin/galleries.php:858
850
+ msgid "Choose Module for Gallery"
851
+ msgstr "Izaberi modul za galeriju"
852
+
853
+ #: admin/galleries.php:297 admin/galleries.php:899 admin/modules.php:114
854
+ #: admin/modules.php:159
855
+ msgid "Version"
856
+ msgstr "Verzija"
857
+
858
+ #: admin/galleries.php:305 admin/galleries.php:907
859
+ msgid "No installed modules"
860
+ msgstr "Nema instaliranih modula"
861
+
862
+ #: admin/galleries.php:356 inc/shortcodes.php:66
863
+ msgid "No gallery with ID #%s in database"
864
+ msgstr "U bazi podataka ne postoji galerija koja ima ID#%s"
865
+
866
+ #: admin/galleries.php:436
867
+ msgid ""
868
+ "Module `%s` is broken. Choose another module from the list and save settings"
869
+ msgstr ""
870
+ "Modul `%s` ne radi. Izaberite drugi modul sa liste i sačuvajte podešavanja. "
871
+
872
+ #: admin/galleries.php:439
873
+ msgid ""
874
+ "Can't get module with name `%s`. Choose module from the list and save "
875
+ "settings"
876
+ msgstr ""
877
+ "Ne možete dobiti modul sa `%s` imenom. Izaberite modul sa liste i sačuvajte "
878
+ "podešavanja. "
879
+
880
+ #: admin/galleries.php:442
881
+ msgid ""
882
+ "Module is not selected for this gallery. Choose module from the list and "
883
+ "save settings"
884
+ msgstr ""
885
+ "Modul za ovu galeriju nije odabran. Izaberite modul sa liste i sačuvajte "
886
+ "podešavanja. "
887
+
888
+ #: admin/galleries.php:463
889
+ msgid "Manage Galleries"
890
+ msgstr "Upravljaj galerijama"
891
+
892
+ #: admin/galleries.php:468
893
+ msgid "Cancel preview module"
894
+ msgstr "Otkaži pregled modula"
895
+
896
+ #: admin/galleries.php:469
897
+ msgid "Save with new module"
898
+ msgstr "Sačuvaj sa novim modulom"
899
+
900
+ #: admin/galleries.php:474
901
+ msgid "Confirm reset gallery options"
902
+ msgstr "Potvrdi opcije za resetovanje galerije"
903
+
904
+ #: admin/galleries.php:474
905
+ msgid "Reset to default"
906
+ msgstr "Vrati na podrazumevane vrednosti"
907
+
908
+ #: admin/galleries.php:476
909
+ msgid "Save"
910
+ msgstr "Sačuvaj"
911
+
912
+ #: admin/galleries.php:493
913
+ msgid ""
914
+ "This module is broken or outdated. Please, go to Modules page and update/"
915
+ "install module."
916
+ msgstr ""
917
+ "Ovaj modul ne radi ili je zastareo. Idite na stranicu za module i ažurirajte/"
918
+ "instalirajte modul."
919
+
920
+ #: admin/galleries.php:497
921
+ msgid "General Settings"
922
+ msgstr "Opšta podešavanja"
923
+
924
+ #: admin/galleries.php:508
925
+ msgid "Gallery module:"
926
+ msgstr "Modul galerije:"
927
+
928
+ #: admin/galleries.php:510
929
+ msgid "Preview module:"
930
+ msgstr "Pregledaj modul:"
931
+
932
+ #: admin/galleries.php:511
933
+ msgid "Note: Module changed to %s, but not saved yet"
934
+ msgstr "Napomena: Modul je promenjen na %s, ali još nije sačuvan"
935
+
936
+ #: admin/galleries.php:514
937
+ msgid "Gallery author:"
938
+ msgstr "Autor galerije"
939
+
940
+ #: admin/galleries.php:516
941
+ msgid "Click to choose author for gallery"
942
+ msgstr "Kliknite da biste odabrali autora galerije"
943
+
944
+ #: admin/galleries.php:516
945
+ msgid "(no author / shared albums)"
946
+ msgstr "(nema autora / deljeni albumi)"
947
+
948
+ #: admin/galleries.php:518
949
+ msgid ""
950
+ "Note: Author changed but not saved yet. You can see Albums list only of "
951
+ "chosen author"
952
+ msgstr ""
953
+ "Napomena: Autor je promenjen, ali još nije sačuvan. Možete videti listu "
954
+ "albuma isključivo odabranog autora"
955
+
956
+ #: admin/galleries.php:525
957
+ msgid "Shortcode:"
958
+ msgstr "Shortcode:"
959
+
960
+ #: admin/galleries.php:545
961
+ msgid "Show supported files from"
962
+ msgstr "Prikaži podržane datoteke od:"
963
+
964
+ #: admin/galleries.php:555 admin/gmedia.php:118 admin/gmedia.php:120
965
+ #: admin/wpmedia.php:82 admin/wpmedia.php:84
966
+ msgid "Filter"
967
+ msgstr "Filter"
968
+
969
+ #: admin/galleries.php:575
970
+ msgid "Choose Categories"
971
+ msgstr "Izaberi kategorije"
972
+
973
+ #: admin/galleries.php:576 admin/galleries.php:577
974
+ msgid "Choose Categories..."
975
+ msgstr "Izaberi kategorije..."
976
+
977
+ #: admin/galleries.php:596
978
+ msgid "Choose Tags"
979
+ msgstr "Izaberi oznake"
980
+
981
+ #: admin/galleries.php:597 admin/galleries.php:598
982
+ msgid "Choose Tags..."
983
+ msgstr "Izaberi oznake..."
984
+
985
+ #: admin/galleries.php:619
986
+ msgid "Choose Albums"
987
+ msgstr "Izaberi albume"
988
+
989
+ #: admin/galleries.php:620 admin/galleries.php:621
990
+ msgid "Choose Albums..."
991
+ msgstr "Izaberi albume..."
992
+
993
+ #: admin/galleries.php:625
994
+ msgid ""
995
+ "You can choose Albums from the same author as Gallery author or Albums "
996
+ "without author"
997
+ msgstr ""
998
+ "Možete odabrati albume od istog autora, kao što je autor Galerije ili albume "
999
+ "bez autora."
1000
+
1001
+ #: admin/galleries.php:630
1002
+ msgid ""
1003
+ "Selected Gmedia IDs <small class=\"text-muted\">separated by comma</small>"
1004
+ msgstr ""
1005
+ "ID odabranih Gmedia <small class=\"text-muted\">odvojeni zarezima </small>"
1006
+
1007
+ #: admin/galleries.php:632
1008
+ msgid "Gmedia IDs..."
1009
+ msgstr "ID Gmedia..."
1010
+
1011
+ #: admin/galleries.php:651
1012
+ msgid "Last edited:"
1013
+ msgstr "Poslednji put uređen:"
1014
+
1015
+ #: admin/galleries.php:657
1016
+ msgid "Gallery ID:"
1017
+ msgstr "ID galerije:"
1018
+
1019
+ #: admin/galleries.php:658
1020
+ msgid "Gallery URL:"
1021
+ msgstr "URL galerije:"
1022
+
1023
+ #: admin/galleries.php:667
1024
+ msgid ""
1025
+ "update <a href=\"options-permalink.php\">Permalink Settings</a> if above "
1026
+ "link not working"
1027
+ msgstr ""
1028
+ "Ažuriraj <a href=\"options-permalink.php\">Permalink podešavanja</a> ako "
1029
+ "gornji link ne radi."
1030
+
1031
+ #: admin/galleries.php:670
1032
+ msgid "Gallery Preview:"
1033
+ msgstr "Pregled galerije:"
1034
+
1035
+ #: admin/gmedia.php:75
1036
+ msgid "Selected Author:"
1037
+ msgstr "Odabrani autor:"
1038
+
1039
+ #: admin/gmedia.php:106 admin/gmedia.php:145 admin/wpmedia.php:68
1040
+ #: admin/wpmedia.php:103
1041
+ msgid "Images"
1042
+ msgstr "Slike"
1043
+
1044
+ #: admin/gmedia.php:107 admin/gmedia.php:152 admin/wpmedia.php:69
1045
+ #: admin/wpmedia.php:111
1046
+ msgid "Audio"
1047
+ msgstr "Audio"
1048
+
1049
+ #: admin/gmedia.php:108 admin/gmedia.php:159 admin/wpmedia.php:70
1050
+ #: admin/wpmedia.php:119
1051
+ msgid "Video"
1052
+ msgstr "Video"
1053
+
1054
+ #: admin/gmedia.php:118 admin/wpmedia.php:82
1055
+ msgid "Reset Filter"
1056
+ msgstr "Resetuj filter"
1057
+
1058
+ #: admin/gmedia.php:127
1059
+ msgid "FILTER BY AUTHOR"
1060
+ msgstr "Filtrirao autor"
1061
+
1062
+ #: admin/gmedia.php:132
1063
+ msgid "Show all authors"
1064
+ msgstr "Prikaži sve autore"
1065
+
1066
+ #: admin/gmedia.php:134 admin/wpmedia.php:91
1067
+ msgid "TYPE"
1068
+ msgstr "Vrste"
1069
+
1070
+ #: admin/gmedia.php:167 admin/wpmedia.php:127
1071
+ msgid "Other"
1072
+ msgstr "Drugi"
1073
+
1074
+ #: admin/gmedia.php:168
1075
+ msgid "COLLECTIONS"
1076
+ msgstr "KOLEKCIJE"
1077
+
1078
+ #: admin/gmedia.php:195
1079
+ msgid "Toggle Edit Mode"
1080
+ msgstr "Toggle režim uređivanja"
1081
+
1082
+ #: admin/gmedia.php:209
1083
+ msgid "Enter Edit Mode"
1084
+ msgstr "Unesi režim uređivanja"
1085
+
1086
+ #: admin/gmedia.php:223 admin/gmedia.php:294
1087
+ msgid "Quick Gallery from Selected"
1088
+ msgstr "Brza galerija od izabranih"
1089
+
1090
+ #: admin/gmedia.php:229
1091
+ msgid "Assign Category..."
1092
+ msgstr "Dodeli kategoriju..."
1093
+
1094
+ #: admin/gmedia.php:235
1095
+ msgid "Move to Album..."
1096
+ msgstr "Prebaci u album..."
1097
+
1098
+ #: admin/gmedia.php:246
1099
+ msgid "Delete Tags..."
1100
+ msgstr "Obriši oznake..."
1101
+
1102
+ #: admin/gmedia.php:260
1103
+ msgid "Update Metadata in Database"
1104
+ msgstr "Ažuriraj metapodatke u bazi podataka"
1105
+
1106
+ #: admin/gmedia.php:265
1107
+ msgid "Exit Edit Mode"
1108
+ msgstr "Izađi iz režima uređivanja"
1109
+
1110
+ #: admin/gmedia.php:287
1111
+ msgid "Show all gmedia items"
1112
+ msgstr "Prikaži sve gmedia stavke"
1113
+
1114
+ #: admin/gmedia.php:311 admin/terms.php:257 admin/terms.php:389
1115
+ msgid "Info:"
1116
+ msgstr "Info:"
1117
+
1118
+ #: admin/gmedia.php:367 admin/gmedia.php:483 admin/import.php:265
1119
+ msgid "Album"
1120
+ msgstr "Album"
1121
+
1122
+ #: admin/gmedia.php:382 admin/gmedia.php:498 admin/gmedia.php:655
1123
+ #: admin/import.php:264
1124
+ msgid "Category"
1125
+ msgstr "Kategorija"
1126
+
1127
+ #: admin/gmedia.php:421 admin/gmedia.php:537 inc/media-upload.php:176
1128
+ msgid "Size"
1129
+ msgstr "Veličina"
1130
+
1131
+ #: admin/gmedia.php:425 admin/gmedia.php:541 admin/gmedia.php:725
1132
+ msgid "Filename"
1133
+ msgstr "Naziv datoteke"
1134
+
1135
+ #: admin/gmedia.php:432 admin/gmedia.php:548
1136
+ msgid "Last Modified Date"
1137
+ msgstr "Datum poslednje izmene"
1138
+
1139
+ #: admin/gmedia.php:444
1140
+ msgid "Edit Data"
1141
+ msgstr "Uredi podatke"
1142
+
1143
+ #: admin/gmedia.php:448 admin/gmedia.php:580
1144
+ msgid "Edit Image"
1145
+ msgstr "Uredi sliku"
1146
+
1147
+ #: admin/gmedia.php:450 admin/gmedia.php:560 admin/gmedia.php:583
1148
+ msgid "View Original"
1149
+ msgstr "Vidi original"
1150
+
1151
+ #: admin/gmedia.php:454 admin/gmedia.php:587
1152
+ msgid ""
1153
+ "You are about to permanently delete %s file.\n"
1154
+ "\r'Cancel' to stop, 'OK' to delete."
1155
+ msgstr ""
1156
+ "Pripremate se da trajno obrišete %s datoteku. Kliknite na ‘Otkaži’ da biste "
1157
+ "obustavili akciju, a na ‘OK’ da biste obrisali."
1158
+
1159
+ #: admin/gmedia.php:454 admin/gmedia.php:588
1160
+ msgid "Delete"
1161
+ msgstr "Obriši"
1162
+
1163
+ #: admin/gmedia.php:455
1164
+ msgid ""
1165
+ "You are about to delete record from DB for %s file.\n"
1166
+ "\r'Cancel' to stop, 'OK' to delete."
1167
+ msgstr ""
1168
+ "Pripremate se da obrišete zapis iz baze podataka za %s datoteku. Kliknite na "
1169
+ "‘Otkaži’ da biste obustavili akciju, a na ‘OK’ da biste obrisali."
1170
+
1171
+ #: admin/gmedia.php:455
1172
+ msgid "Delete DB record (leave file on the server)"
1173
+ msgstr "Obriši zapis baze podataka (ostavi zapis na serveru)"
1174
+
1175
+ #: admin/gmedia.php:608
1176
+ msgid "Link URL"
1177
+ msgstr "Link URL"
1178
+
1179
+ #: admin/gmedia.php:633
1180
+ msgid "Cover"
1181
+ msgstr "Korice"
1182
+
1183
+ #: admin/gmedia.php:636
1184
+ msgid "Gmedia ID or Image URL"
1185
+ msgstr "ID Gmedia ili URL slike"
1186
+
1187
+ #: admin/gmedia.php:698
1188
+ msgid "Album "
1189
+ msgstr "Album"
1190
+
1191
+ #: admin/gmedia.php:716
1192
+ msgid "Tags "
1193
+ msgstr "Oznake"
1194
+
1195
+ #: admin/gmedia.php:770
1196
+ msgid "File Size"
1197
+ msgstr "Veličina datoteke"
1198
+
1199
+ #: admin/gmedia.php:774
1200
+ msgid "Dimensions"
1201
+ msgstr "Dimenzije"
1202
+
1203
+ #: admin/gmedia.php:777
1204
+ msgid "Uploaded"
1205
+ msgstr "Otpremljene"
1206
+
1207
+ #: admin/gmedia.php:848 inc/media-upload.php:205
1208
+ msgid "Add Media"
1209
+ msgstr "Dodaj medije"
1210
+
1211
+ #: admin/gmedia.php:859
1212
+ msgid "Back to top"
1213
+ msgstr "Nazad na vrh"
1214
+
1215
+ #: admin/import.php:24
1216
+ msgid "You do not have permission to upload files."
1217
+ msgstr "Nemate dozvolu za otpremanje datoteka."
1218
+
1219
+ #: admin/import.php:59 update.php:260
1220
+ msgid "Something went wrong..."
1221
+ msgstr "Nešto nije u redu..."
1222
+
1223
+ #: admin/import.php:72 update.php:276
1224
+ msgid "File not exists: %s"
1225
+ msgstr "Datoteka ne postoji: %s"
1226
+
1227
+ #: admin/import.php:81 admin/import.php:106 admin/import.php:118
1228
+ #: update.php:351 update.php:362
1229
+ msgid ""
1230
+ "Unable to create directory `%s`. Is its parent directory writable by the "
1231
+ "server?"
1232
+ msgstr ""
1233
+ "Direktorijum nije mogao biti kreiran `%s`. Da li server može da piše u "
1234
+ "njegovom nadređenom direktorijumu?"
1235
+
1236
+ #: admin/import.php:88
1237
+ msgid "Directory `%s` or its subfolders are not writable by the server."
1238
+ msgstr ""
1239
+ "Direktorijum `%s` ili njegovi subfolderi nisu podložni pisanju servera."
1240
+
1241
+ #: admin/import.php:94
1242
+ msgid "Can't copy file from `%s` to `%s`"
1243
+ msgstr "Datoteka iz`%s`ne može da se kopira u`%s`."
1244
+
1245
+ #: admin/import.php:113 admin/import.php:125 update.php:357 update.php:368
1246
+ msgid "Directory `%s` is not writable by the server."
1247
+ msgstr "Direktorijum `%s` nije podložan pisanju servera."
1248
+
1249
+ #: admin/import.php:192 inc/core.php:1386
1250
+ msgid "Could not read image size. Invalid image was deleted."
1251
+ msgstr "Veličina slike nije se mogla pročitati. Pronađena je nevažeća slika."
1252
+
1253
+ #: admin/import.php:256 update.php:439
1254
+ msgid "success (ID #%s)"
1255
+ msgstr "uspeh (ID #%s)"
1256
+
1257
+ #: admin/import.php:330
1258
+ msgid "Folder `%s` is empty"
1259
+ msgstr "Folder `%s` je prazan"
1260
+
1261
+ #: admin/import.php:333
1262
+ msgid "No folder chosen"
1263
+ msgstr "Nije izabran folder"
1264
+
1265
+ #: admin/import.php:338
1266
+ msgid "Import from Flagallery plugin"
1267
+ msgstr "Uvezi iz Flagallery plugin-a"
1268
+
1269
+ #: admin/import.php:360 admin/import.php:397
1270
+ msgid "Import `%s` gallery"
1271
+ msgstr "Uvezi `%s` galeriju"
1272
+
1273
+ #: admin/import.php:364 admin/import.php:401
1274
+ msgid "gallery contains 0 images"
1275
+ msgstr "Galerija sadrži 0 slika"
1276
+
1277
+ #: admin/import.php:371 admin/import.php:407
1278
+ msgid "No gallery chosen"
1279
+ msgstr "Nije odabrana galerija"
1280
+
1281
+ #: admin/import.php:375
1282
+ msgid "Import from NextGen plugin"
1283
+ msgstr "Uvezi iz NextGen plugin-a"
1284
+
1285
+ #: admin/import.php:430
1286
+ msgid "No items chosen"
1287
+ msgstr "Nisu odabrane stavke"
1288
+
1289
+ #: admin/modules.php:45
1290
+ msgid "Error loading remote xml..."
1291
+ msgstr "Greška prilikom učitavanja udaljenog xml-a... "
1292
+
1293
+ #: admin/modules.php:65
1294
+ msgid "Install Module ZIP"
1295
+ msgstr "Instaliraj ZIP modul"
1296
+
1297
+ #: admin/modules.php:67
1298
+ msgid "Installed Modules"
1299
+ msgstr "Instalirani moduli"
1300
+
1301
+ #: admin/modules.php:100 admin/modules.php:167
1302
+ msgid "Loading..."
1303
+ msgstr "Učitavanje..."
1304
+
1305
+ #: admin/modules.php:100
1306
+ msgid "Update Module"
1307
+ msgstr "Ažuriraj modul"
1308
+
1309
+ #: admin/modules.php:120 admin/modules.php:165
1310
+ msgid "View Demo"
1311
+ msgstr "Vidi demo"
1312
+
1313
+ #: admin/modules.php:140
1314
+ msgid "Not Installed Modules"
1315
+ msgstr "Nema instaliranih modula"
1316
+
1317
+ #: admin/modules.php:167
1318
+ msgid "Install Module"
1319
+ msgstr "Instaliraj modul"
1320
+
1321
+ #: admin/modules.php:184
1322
+ msgid "Install a plugin in .zip format"
1323
+ msgstr "Instaliraj plugin u .zip formatu"
1324
+
1325
+ #: admin/modules.php:187
1326
+ msgid ""
1327
+ "If you have a module in a .zip format, you may install it by uploading it "
1328
+ "here."
1329
+ msgstr ""
1330
+ "Ako imate modul u .zip formatu, možete ga instalirati tako što ćete ga "
1331
+ "otpremiti ovde."
1332
+
1333
+ #: admin/modules.php:189
1334
+ msgid "Module zip file"
1335
+ msgstr "Zip datoteka modula"
1336
+
1337
+ #: admin/modules.php:194
1338
+ msgid "Install"
1339
+ msgstr "Instaliraj"
1340
+
1341
+ #: admin/processor.php:91 admin/processor.php:457 admin/processor.php:462
1342
+ msgid "You are not allowed to be here"
1343
+ msgstr "Nije vam dozvoljeno da budete ovde"
1344
+
1345
+ #: admin/processor.php:97
1346
+ msgid "You are not allowed to manage galleries"
1347
+ msgstr "Nije vam dozvoljeno da upravljate galerijama"
1348
+
1349
+ #: admin/processor.php:103 admin/processor.php:604
1350
+ msgid "Gallery Name is not specified"
1351
+ msgstr "Naziv galerije nije naveden"
1352
+
1353
+ #: admin/processor.php:107 admin/processor.php:608
1354
+ msgid "Gallery name can't be only digits"
1355
+ msgstr "Naziv galerije ne može da se sastoji samo od cifara"
1356
+
1357
+ #: admin/processor.php:111
1358
+ msgid "Choose gmedia from library for quick gallery"
1359
+ msgstr "Izaberite gmedia iz biblioteke za brzu galeriju"
1360
+
1361
+ #: admin/processor.php:134
1362
+ msgid "Gallery \"%s\" successfuly saved. Shortcode: [gmedia id=%d]"
1363
+ msgstr "Galerija \"%s\" uspešno sačuvana.Shortcode: [gmedia id=%d]"
1364
+
1365
+ #: admin/processor.php:179
1366
+ msgid "%d items now uncategorized"
1367
+ msgstr "%d stavki bez kategorizacije"
1368
+
1369
+ #: admin/processor.php:245 inc/db.connect.php:2720
1370
+ msgid "Could not update statuses for gmedia items in the database"
1371
+ msgstr "Statusi za gmedia stavke nisu mogli da se ažuriraju u bazi podataka"
1372
+
1373
+ #: admin/processor.php:386 admin/processor.php:401
1374
+ msgid "%d items updated successfuly"
1375
+ msgstr "%d stavki uspešno ažurirano"
1376
+
1377
+ #: admin/processor.php:434
1378
+ msgid "%d item(s) deleted successfuly"
1379
+ msgstr "%d stavki(s) uspešno obrisano"
1380
+
1381
+ #: admin/processor.php:436
1382
+ msgid "%d record(s) deleted from database successfuly. Original file(s) safe"
1383
+ msgstr ""
1384
+ "%d zapisa(s) uspešno obrisano iz baze podataka. Originalne datoteke(s) "
1385
+ "bezbedne. "
1386
+
1387
+ #: admin/processor.php:450
1388
+ msgid "You are not allowed to delete files"
1389
+ msgstr "Nije vam dozvoljeno da brišete datoteke"
1390
+
1391
+ #: admin/processor.php:496
1392
+ msgid "You are not allowed to delete terms"
1393
+ msgstr "Nije vam dozvoljeno da brišete termine"
1394
+
1395
+ #: admin/processor.php:580
1396
+ msgid "You are not allowed to manage tags"
1397
+ msgstr "Nije vam dozvoljeno da upravljate oznakama"
1398
+
1399
+ #: admin/processor.php:586 admin/processor.php:760
1400
+ msgid "You are not allowed to manage gmedia galleries"
1401
+ msgstr "Nije vam dozvoljeno da upravljate gmedia galerijama "
1402
+
1403
+ #: admin/processor.php:612
1404
+ msgid "Something goes wrong... Choose module, please"
1405
+ msgstr "Nešto nije u redu… Molimo, izaberite modul"
1406
+
1407
+ #: admin/processor.php:617
1408
+ msgid "Choose gallery source, please (tags, albums, categories...)"
1409
+ msgstr "Izaberite izvor galerije (oznake, albume, kategorije…)"
1410
+
1411
+ #: admin/processor.php:647 admin/processor.php:707
1412
+ msgid "Can't load data from `%s` module"
1413
+ msgstr "Podaci iz `%s` modula ne mogu da se učitaju"
1414
+
1415
+ #: admin/processor.php:665 admin/processor.php:677
1416
+ msgid "Gallery #%d successfuly saved"
1417
+ msgstr "Galerija #%d uspešno sačuvana"
1418
+
1419
+ #: admin/processor.php:718
1420
+ msgid "Gallery settings are reset"
1421
+ msgstr "Podešavanja galerije vraćena su na početne vrednosti"
1422
+
1423
+ #: admin/processor.php:733
1424
+ msgid "Error while delete gallery #%d"
1425
+ msgstr "Greška prilikom brisanja #%d galerije"
1426
+
1427
+ #: admin/processor.php:766
1428
+ msgid "You are not allowed to manage gmedia modules"
1429
+ msgstr "Nije vam dozvoljeno da upravljate gmedia modulima"
1430
+
1431
+ #: admin/processor.php:773
1432
+ msgid "The uploaded file could not be moved to %s"
1433
+ msgstr "Otpremljena datoteka nije mogla biti prebačena u %s"
1434
+
1435
+ #: admin/processor.php:793
1436
+ msgid "The `%s` file unzipped to module's directory"
1437
+ msgstr "`%s` datoteka raspakovana u direktorijumu modula"
1438
+
1439
+ #: admin/processor.php:803
1440
+ msgid "You are not allowed to change gmedia settings"
1441
+ msgstr "Nije vam dozvoljeno da menjate gmedia podešavanja"
1442
+
1443
+ #: admin/processor.php:817
1444
+ msgid "License Key deactivated"
1445
+ msgstr "Ključ licence deaktiviran"
1446
+
1447
+ #: admin/processor.php:831
1448
+ msgid "Settings saved"
1449
+ msgstr "Podešavanja sačuvana"
1450
+
1451
+ #: admin/processor.php:861
1452
+ msgid "License Key activated successfully"
1453
+ msgstr "Ključ licence uspešno aktiviran"
1454
+
1455
+ #: admin/processor.php:866
1456
+ msgid "Error"
1457
+ msgstr "Greška"
1458
+
1459
+ #: admin/processor.php:871
1460
+ msgid "Empty License Key"
1461
+ msgstr "Prazan ključ licence"
1462
+
1463
+ #: admin/processor.php:894
1464
+ msgid "All settings set to default"
1465
+ msgstr "Sve postavke podešene na podrazumevane "
1466
+
1467
+ #: admin/processor.php:899
1468
+ msgid "You are not allowed to import media in Gmedia Library"
1469
+ msgstr "Nije vam dozvoljeno da uvezete medije u Gmedia biblioteku"
1470
+
1471
+ #: admin/settings.php:20
1472
+ msgid "Reset all Gmedia settings?"
1473
+ msgstr "Vrati sva Gmedia podešavanja na početne vrednosti"
1474
+
1475
+ #: admin/settings.php:20
1476
+ msgid "Reset Settings"
1477
+ msgstr "Vrati sva podešavanja na početne vrednosti"
1478
+
1479
+ #: admin/settings.php:21 admin/terms.php:779
1480
+ msgid "Update"
1481
+ msgstr "Ažuriraj"
1482
+
1483
+ #: admin/settings.php:32
1484
+ msgid "Premium Settings"
1485
+ msgstr "Premium podešavanja"
1486
+
1487
+ #: admin/settings.php:34
1488
+ msgid "Roles/Capabilities Manager"
1489
+ msgstr "Upravnik ulogama/kompetencijama"
1490
+
1491
+ #: admin/settings.php:35
1492
+ msgid "Other Settings"
1493
+ msgstr "Ostala podešavanja"
1494
+
1495
+ #: admin/settings.php:39
1496
+ msgid ""
1497
+ "Enter License Key to remove backlink label from premium gallery modules."
1498
+ msgstr ""
1499
+ "Unesite ključ licence da biste uklonili oznaku povratnog linka iz premium "
1500
+ "modula galerije"
1501
+
1502
+ #: admin/settings.php:43
1503
+ msgid "License Key"
1504
+ msgstr "Ključ licence"
1505
+
1506
+ #: admin/settings.php:54
1507
+ msgid "Activate Key"
1508
+ msgstr "Aktiviraj ključ"
1509
+
1510
+ #: admin/settings.php:60
1511
+ msgid ""
1512
+ "Select the lowest role which should be able to access the follow "
1513
+ "capabilities. Gmedia Gallery supports the standard roles from WordPress."
1514
+ msgstr ""
1515
+ "Odaberite najnižu ulogu koja može da pristupi sledećim kompetencijama. "
1516
+ "Gmedia Gallery podržava standardne WordPress uloge."
1517
+
1518
+ #: admin/settings.php:66
1519
+ msgid "Who can view Gmedia Gallery admin pages"
1520
+ msgstr "Ko može da vidi stranice administratora za Gmedia galeriju? "
1521
+
1522
+ #: admin/settings.php:71
1523
+ msgid "Edit Media"
1524
+ msgstr "Uredi medije"
1525
+
1526
+ #: admin/settings.php:74
1527
+ msgid ""
1528
+ "Who can edit media title, description and other properties of uploaded files"
1529
+ msgstr ""
1530
+ "Ko može da uređuje naslove medija, opise i druge atribute otpremljenih "
1531
+ "datoteka"
1532
+
1533
+ #: admin/settings.php:77
1534
+ msgid "Delete Media"
1535
+ msgstr "Obriši medije"
1536
+
1537
+ #: admin/settings.php:80
1538
+ msgid "Who can delete uploaded files from Gmedia Library"
1539
+ msgstr "Ko može da briše otpremljene datoteke iz Gmedia biblioteke"
1540
+
1541
+ #: admin/settings.php:83
1542
+ msgid "Show Others Media"
1543
+ msgstr "Prikaži medije drugih"
1544
+
1545
+ #: admin/settings.php:86
1546
+ msgid "Who can see files uploaded by other users"
1547
+ msgstr "Ko može da vidi datoteke koje otpremaju ostali korisnici"
1548
+
1549
+ #: admin/settings.php:90
1550
+ msgid "Edit Others Media"
1551
+ msgstr "Uredi medije drugih"
1552
+
1553
+ #: admin/settings.php:93
1554
+ msgid "Who can edit files, albums/tags and galleries of other users"
1555
+ msgstr "Ko može da uređuje datoteke, albume/oznake i galerije drugih korisnika"
1556
+
1557
+ #: admin/settings.php:96
1558
+ msgid "Delete Others Media"
1559
+ msgstr "Obriši medije drugih"
1560
+
1561
+ #: admin/settings.php:99
1562
+ msgid "Who can delete files, albums/tags and galleries of other users"
1563
+ msgstr "Ko može da briše datoteke, albume/oznake i galerije ostalih korisnika"
1564
+
1565
+ #: admin/settings.php:104
1566
+ msgid "Upload Media Files"
1567
+ msgstr "Otpremi datoteke medija"
1568
+
1569
+ #: admin/settings.php:107
1570
+ msgid "Who can upload files to Gmedia Library"
1571
+ msgstr "Ko može da otprema datoteke u Gmedia biblioteku"
1572
+
1573
+ #: admin/settings.php:111
1574
+ msgid "Import Media Files"
1575
+ msgstr "Uvezi datoteke medija"
1576
+
1577
+ #: admin/settings.php:114
1578
+ msgid "Who can import files to Gmedia Library"
1579
+ msgstr "Ko može da uvozi datoteke u Gmedia biblioteku"
1580
+
1581
+ #: admin/settings.php:122
1582
+ msgid "Who can assign available terms to media files"
1583
+ msgstr "Ko može da dodeli raspoložive termine datotekama medija"
1584
+
1585
+ #: admin/settings.php:126
1586
+ msgid "Manage Albums"
1587
+ msgstr "Upravljaj albumima"
1588
+
1589
+ #: admin/settings.php:129
1590
+ msgid "Who can add and edit own albums"
1591
+ msgstr "Ko može da doda i da uređuje sopstvene albume"
1592
+
1593
+ #: admin/settings.php:132
1594
+ msgid "Manage Tags"
1595
+ msgstr "Upravljaj oznakama"
1596
+
1597
+ #: admin/settings.php:135
1598
+ msgid "Who can add and edit tags"
1599
+ msgstr "Ko može da doda i da uređuje oznake"
1600
+
1601
+ #: admin/settings.php:138
1602
+ msgid "Delete Terms"
1603
+ msgstr "Obriši termine"
1604
+
1605
+ #: admin/settings.php:141
1606
+ msgid ""
1607
+ "Who can delete own albums or all terms if allowed \"Delete Others Media\""
1608
+ msgstr ""
1609
+ "Ko može da briše svoje albume ili sve termine ako je aktivirana opcija "
1610
+ "\"Obriši medije drugih\""
1611
+
1612
+ #: admin/settings.php:146
1613
+ msgid "Galleries"
1614
+ msgstr "Galerije"
1615
+
1616
+ #: admin/settings.php:149
1617
+ msgid "Who can add, edit and delete own galleries"
1618
+ msgstr "Ko može da dodaje, uređuje i briše svoje galerije"
1619
+
1620
+ #: admin/settings.php:156
1621
+ msgid "Who can manage modules"
1622
+ msgstr "Ko može da upravlja modulima"
1623
+
1624
+ #: admin/settings.php:163
1625
+ msgid ""
1626
+ "Who can change settings. Note: Capabilites can be changed only by "
1627
+ "administrator"
1628
+ msgstr ""
1629
+ "Ko može da menja postavke. Napomena: Kompetencije može da menja isključivo "
1630
+ "administrator"
1631
+
1632
+ #: admin/settings.php:170
1633
+ msgid "When delete (uninstall) plugin"
1634
+ msgstr "Kada obrisati (deinstalirati) plugin"
1635
+
1636
+ #: admin/settings.php:172
1637
+ msgid "Delete database and all uploaded files"
1638
+ msgstr "Obriši bazu podataka i sve otpremljene datoteke"
1639
+
1640
+ #: admin/settings.php:173
1641
+ msgid "Delete database only and leave uploaded files"
1642
+ msgstr "Obriši samo bazu podataka i ostavi otpremljene datoteke"
1643
+
1644
+ #: admin/settings.php:174
1645
+ msgid "Do not delete database and uploaded files"
1646
+ msgstr "Nemoj brisati bazu podataka ni otpremljene datoteke"
1647
+
1648
+ #: admin/settings.php:178
1649
+ msgid "Forbid theme to format Gmedia shortcode's content"
1650
+ msgstr "Zabrani temi da formatira Gmedia shortcode sadržaj"
1651
+
1652
+ #: admin/settings.php:182
1653
+ msgid "Raw output for Gmedia Shortcode"
1654
+ msgstr "Sirov izlaz za Gmedia Shortcode"
1655
+
1656
+ #: admin/settings.php:185
1657
+ msgid ""
1658
+ "Some themes reformat shortcodes and break it functionality (mostly when you "
1659
+ "add description to images). Turning this on should solve this problem."
1660
+ msgstr ""
1661
+ "Neke teme ponovo formatiraju shortcode-ove i uništavaju im funkcionalnost "
1662
+ "(najčešće kad slici dodate opis). Aktiviranjem ove opcije trebalo bi da "
1663
+ "rešite taj problem."
1664
+
1665
+ #: admin/settings.php:192
1666
+ msgid "Memory Limit: "
1667
+ msgstr "Ograničenje memorije:"
1668
+
1669
+ #: admin/settings.php:193
1670
+ msgid "Memory Used: "
1671
+ msgstr "Upotrebljena memorija:"
1672
+
1673
+ #: admin/settings.php:196
1674
+ msgid "Under constraction..."
1675
+ msgstr "Radovi u toku..."
1676
+
1677
+ #: admin/terms.php:177 admin/terms.php:696
1678
+ msgid "Name"
1679
+ msgstr "Naziv"
1680
+
1681
+ #: admin/terms.php:179 admin/terms.php:699
1682
+ msgid "Album Name"
1683
+ msgstr "Naziv albuma"
1684
+
1685
+ #: admin/terms.php:190 admin/terms.php:710
1686
+ msgid "Order gmedia"
1687
+ msgstr "Redosled gmedia"
1688
+
1689
+ #: admin/terms.php:192 admin/terms.php:713
1690
+ msgid "user defined"
1691
+ msgstr "korisnik definisan"
1692
+
1693
+ #: admin/terms.php:193 admin/terms.php:715
1694
+ msgid "by ID"
1695
+ msgstr "prema ID-ju"
1696
+
1697
+ #: admin/terms.php:194 admin/terms.php:717
1698
+ msgid "by title"
1699
+ msgstr "prema naslovu"
1700
+
1701
+ #: admin/terms.php:195 admin/terms.php:719
1702
+ msgid "by date"
1703
+ msgstr "prema datumu"
1704
+
1705
+ #: admin/terms.php:196 admin/terms.php:721
1706
+ msgid "by last modified date"
1707
+ msgstr "prema datumu poslednje izmene"
1708
+
1709
+ #: admin/terms.php:197 admin/terms.php:723
1710
+ msgid "Random"
1711
+ msgstr "Nasumičan"
1712
+
1713
+ #: admin/terms.php:201 admin/terms.php:727
1714
+ msgid "Sort order"
1715
+ msgstr "Sortiraj prema redosledu"
1716
+
1717
+ #: admin/terms.php:245
1718
+ msgid "Add New Album"
1719
+ msgstr "Dodaj novi album"
1720
+
1721
+ #: admin/terms.php:257 admin/terms.php:389
1722
+ msgid "You are not allowed to add new terms"
1723
+ msgstr "Nije vam dozvoljeno da dodajete nove termine"
1724
+
1725
+ #: admin/terms.php:367
1726
+ msgid "you can type multiple tags separated by comma"
1727
+ msgstr "Možete uneti višestruke oznake odvojene zarezima"
1728
+
1729
+ #: admin/terms.php:371
1730
+ msgid "Tag Names"
1731
+ msgstr "Nazivi oznaka"
1732
+
1733
+ #: admin/terms.php:380
1734
+ msgid "Add New Tags"
1735
+ msgstr "Dodaj nove oznake"
1736
+
1737
+ #: admin/terms.php:667
1738
+ msgid "Disable Drag and Drop Sorting"
1739
+ msgstr "Deaktiviraj sortiranje prevlačenjem i pozicioniranjem "
1740
+
1741
+ #: admin/terms.php:671
1742
+ msgid "Enable Drag and Drop Sorting"
1743
+ msgstr "Aktiviraj sortiranje prevlačenjem i pozicioniranjem"
1744
+
1745
+ #: admin/terms.php:677
1746
+ msgid "Show Album in Gmedia Library"
1747
+ msgstr "Prikaži album u Gmedia biblioteci"
1748
+
1749
+ #: admin/terms.php:690
1750
+ msgid "Edit Album"
1751
+ msgstr "Uredi album"
1752
+
1753
+ #: admin/terms.php:750
1754
+ msgid "Apply Status for all items in album"
1755
+ msgstr "Primeni status na sve stavke u albumu"
1756
+
1757
+ #: admin/terms.php:878
1758
+ msgid "Total items: %d"
1759
+ msgstr "Ukupan broj stavki %d"
1760
+
1761
+ #: admin/upload.php:19
1762
+ msgid "You do not have permission to upload files in Gmedia Library."
1763
+ msgstr "Nemate dozvolu da otpremate datoteke u Gmedia biblioteku."
1764
+
1765
+ #: admin/upload.php:33
1766
+ msgid "No file name."
1767
+ msgstr "Nema naziva datoteke."
1768
+
1769
+ #: admin/wpmedia.php:146
1770
+ msgid "Import to Gmedia Library..."
1771
+ msgstr "Uvezi u Gmedia biblioteku"
1772
+
1773
+ #: admin/wpmedia.php:185
1774
+ msgid "Sort by filename"
1775
+ msgstr "Sortiraj prema nazivu datoteke"
1776
+
1777
+ #: admin/wpmedia.php:190
1778
+ msgid "File"
1779
+ msgstr "Datoteka"
1780
+
1781
+ #: constants.php:6
1782
+ msgid "No Supported Files in Gallery"
1783
+ msgstr "U galeriji nema podržanih datoteka"
1784
+
1785
+ #: grand-media.php:141
1786
+ msgid "Sorry, Gmedia Gallery works only under WordPress %s or higher"
1787
+ msgstr ""
1788
+ "Žao nam je, Gmedia galerija radi samo pod WordPress verzijom %s ili novijom"
1789
+
1790
+ #: grand-media.php:148
1791
+ msgid ""
1792
+ "Attention! Your server php version is: %s. Gmedia Gallery requires php "
1793
+ "version 5.2+ in order to run properly. Please upgrade your server!"
1794
+ msgstr ""
1795
+ "Pažnja! Verzija vašeg php servera je: %s. Gmedia galerija zahteva php "
1796
+ "verziju 5.2+ da bi radila kako treba. Ažurirajte svoj server!"
1797
+
1798
+ #: grand-media.php:154
1799
+ msgid ""
1800
+ "Attention! Your server safe mode is: ON. Gmedia Gallery requires safe mode "
1801
+ "to be OFF in order to run properly. Please set your server safe mode option!"
1802
+ msgstr ""
1803
+ "Pažnja! Uključen je bezbedan režim servera. Gmedia galerija zahteva da "
1804
+ "bezbedan režim bude isključen da bi radila kako treba. Molimo, podesite "
1805
+ "opciju bezbednog režima svog servera! "
1806
+
1807
+ #: grand-media.php:258
1808
+ msgid "Disable your Popup Blocker and try again."
1809
+ msgstr "Deaktivirajte Popup Blocker i pokušajte ponovo."
1810
+
1811
+ #: grand-media.php:259
1812
+ msgid "downloading..."
1813
+ msgstr "preuzimanje..."
1814
+
1815
+ #: grand-media.php:260
1816
+ msgid "Working. Wait please."
1817
+ msgstr "Rad u toku. Molimo sačekajte."
1818
+
1819
+ #: inc/core.php:180 inc/core.php:1166 inc/core.php:1248 inc/core.php:1274
1820
+ msgid ""
1821
+ "Unable to create directory %s. Is its parent directory writable by the "
1822
+ "server?"
1823
+ msgstr ""
1824
+ "Kreiranje direktorijuma %s nije moguće. Da li je njegov nadređeni "
1825
+ "direktorijum podložan pisanju servera?"
1826
+
1827
+ #: inc/core.php:1180
1828
+ msgid "Directory %s or its subfolders are not writable by the server."
1829
+ msgstr "Direktorijum %s ili njegovi subfolderi ne podležu pisanju servera?"
1830
+
1831
+ #: inc/core.php:1202
1832
+ msgid "Failed to open directory: %s"
1833
+ msgstr "Neuspelo otvaranje %s direktorijuma."
1834
+
1835
+ #: inc/core.php:1220
1836
+ msgid "Failed to open input stream."
1837
+ msgstr "Neuspelo otvaranje ulaznog stream-a."
1838
+
1839
+ #: inc/core.php:1262 inc/core.php:1288
1840
+ msgid "Directory %s is not writable by the server."
1841
+ msgstr "Direktorijum %s nije podložan pisanju servera. "
1842
+
1843
+ #: inc/core.php:1453
1844
+ msgid "File uploaded successful. Assigned ID: %s"
1845
+ msgstr "Datoteka uspešno ažurirana. Dodeljen ID: %s."
1846
+
1847
+ #: inc/core.php:1464
1848
+ msgid "Failed to open output stream."
1849
+ msgstr "Neuspelo otvaranje izlaznog stream-a."
1850
+
1851
+ #: inc/db.connect.php:312
1852
+ msgid "Page"
1853
+ msgstr "Stranica"
1854
+
1855
+ #: inc/db.connect.php:316
1856
+ msgid "of"
1857
+ msgstr "iskljucena"
1858
+
1859
+ #: inc/db.connect.php:2094
1860
+ msgid "Empty Term"
1861
+ msgstr "Prazan termin"
1862
+
1863
+ #: inc/db.connect.php:2101 inc/db.connect.php:2243 inc/db.connect.php:2838
1864
+ #: inc/db.connect.php:3024
1865
+ msgid "Invalid Taxonomy"
1866
+ msgstr "Nevažeća taksonomija"
1867
+
1868
+ #: inc/db.connect.php:2571 inc/db.connect.php:2665
1869
+ msgid "Invalid taxonomy"
1870
+ msgstr "Nevažeća taksonomija"
1871
+
1872
+ #: inc/db.connect.php:2580
1873
+ msgid "Invalid term ID"
1874
+ msgstr "Nevažeći ID termina"
1875
+
1876
+ #: inc/db.connect.php:2584
1877
+ msgid "A name is required for this term"
1878
+ msgstr "Za ovaj termin obaveznan je naziv."
1879
+
1880
+ #: inc/db.connect.php:2604
1881
+ msgid "A term with the name provided already exists."
1882
+ msgstr "Termin sa tim nazivom već postoji."
1883
+
1884
+ #: inc/db.connect.php:2608
1885
+ msgid "Could not insert term into the database"
1886
+ msgstr "Termin nije mogao da se unese u bazu podataka."
1887
+
1888
+ #: inc/db.connect.php:2701
1889
+ msgid "A name is required for term"
1890
+ msgstr "Ime za termin je obavezno"
1891
+
1892
+ #: inc/db.connect.php:2737 inc/db.connect.php:2938
1893
+ msgid "Could not insert gmedia term relationship into the database"
1894
+ msgstr "Veza gmedia termina nije mogla da se unese u bazu podataka"
1895
+
1896
+ #: inc/image-editor.php:19
1897
+ msgid "Do you really want restore original image?"
1898
+ msgstr "Da li stvarno želite da vratite originalnu sliku?"
1899
+
1900
+ #: inc/image-editor.php:19
1901
+ msgid "Restore Original"
1902
+ msgstr "Vrati original"
1903
+
1904
+ #: inc/image-editor.php:22
1905
+ msgid "Do you really want reset all changes?"
1906
+ msgstr "Da li zaista želite da sve promene vratite na početne vrednosti?"
1907
+
1908
+ #: inc/image-editor.php:22
1909
+ msgid "Reset"
1910
+ msgstr "Vrati na početne vrednosti"
1911
+
1912
+ #: inc/image-editor.php:23
1913
+ msgid "Working"
1914
+ msgstr "U toku"
1915
+
1916
+ #: inc/image-editor.php:23
1917
+ msgid "Save image"
1918
+ msgstr "Sačuvaj sliku"
1919
+
1920
+ #: inc/image-editor.php:28
1921
+ msgid "Rotate Counterclockwise"
1922
+ msgstr "Rotiraj u smeru suprotnom od kretanja kazaljke na satu"
1923
+
1924
+ #: inc/image-editor.php:29
1925
+ msgid "Rotate Clockwise"
1926
+ msgstr "Rotiraj u smeru kretanja kazaljke"
1927
+
1928
+ #: inc/image-editor.php:30
1929
+ msgid "Flip Horizontal"
1930
+ msgstr "Okreni horizontalno"
1931
+
1932
+ #: inc/image-editor.php:31
1933
+ msgid "Flip Vertical"
1934
+ msgstr "Okreni vertikalno"
1935
+
1936
+ #: inc/image-editor.php:32
1937
+ msgid "Greyscale"
1938
+ msgstr "Crno-belo"
1939
+
1940
+ #: inc/image-editor.php:33
1941
+ msgid "Invert"
1942
+ msgstr "Obrni"
1943
+
1944
+ #: inc/image-editor.php:45
1945
+ msgid "Processing image"
1946
+ msgstr "Slika se obrađuje"
1947
+
1948
+ #: inc/image-editor.php:53
1949
+ msgid "Brightness"
1950
+ msgstr "Svetlost"
1951
+
1952
+ #: inc/image-editor.php:64
1953
+ msgid "Contrast"
1954
+ msgstr "Kontrast"
1955
+
1956
+ #: inc/image-editor.php:75
1957
+ msgid "Saturation"
1958
+ msgstr "Zasićenje"
1959
+
1960
+ #: inc/image-editor.php:86
1961
+ msgid "Vibrance"
1962
+ msgstr "Treperenje"
1963
+
1964
+ #: inc/image-editor.php:97
1965
+ msgid "Exposure"
1966
+ msgstr "Eksponiranje"
1967
+
1968
+ #: inc/image-editor.php:108
1969
+ msgid "Hue"
1970
+ msgstr "Nijansa"
1971
+
1972
+ #: inc/image-editor.php:119
1973
+ msgid "Sepia"
1974
+ msgstr "Sepia"
1975
+
1976
+ #: inc/image-editor.php:130
1977
+ msgid "Noise"
1978
+ msgstr "Tačkice"
1979
+
1980
+ #: inc/image-editor.php:141
1981
+ msgid "Clip"
1982
+ msgstr "Isečak"
1983
+
1984
+ #: inc/image-editor.php:155
1985
+ msgid "Apply to"
1986
+ msgstr "Primeni na"
1987
+
1988
+ #: inc/image-editor.php:157
1989
+ msgid "Original, Web-image, Thumbnail"
1990
+ msgstr "Original, web slika, sličica"
1991
+
1992
+ #: inc/image-editor.php:158
1993
+ msgid "Web-image, Thumbnail"
1994
+ msgstr "Web slika, sličica"
1995
+
1996
+ #: inc/image-editor.php:159
1997
+ msgid "Thumbnail"
1998
+ msgstr "Sličica"
1999
+
2000
+ #. #-#-#-#-# plugin.pot (Gmedia Gallery 1.2.6) #-#-#-#-#
2001
+ #. Plugin Name of the plugin/theme
2002
+ #: inc/media-upload.php:23
2003
+ msgid "Gmedia Gallery"
2004
+ msgstr "Gmedia galerija"
2005
+
2006
+ #: inc/media-upload.php:158
2007
+ msgid "Link To"
2008
+ msgstr "Link za"
2009
+
2010
+ #: inc/media-upload.php:160
2011
+ msgid "Custom URL"
2012
+ msgstr "prilagođeni URL"
2013
+
2014
+ #: inc/media-upload.php:161
2015
+ msgid "Web size image"
2016
+ msgstr "Veličina web slike"
2017
+
2018
+ #: inc/media-upload.php:162
2019
+ msgid "Original image"
2020
+ msgstr "Originalna slika "
2021
+
2022
+ #: inc/media-upload.php:186
2023
+ msgid "Alignment"
2024
+ msgstr "Poravnanje"
2025
+
2026
+ #: inc/media-upload.php:189
2027
+ msgid "Left"
2028
+ msgstr "Levo"
2029
+
2030
+ #: inc/media-upload.php:190
2031
+ msgid "Center"
2032
+ msgstr "Centralno"
2033
+
2034
+ #: inc/media-upload.php:191
2035
+ msgid "Right"
2036
+ msgstr "Desno"
2037
+
2038
+ #: inc/media-upload.php:218
2039
+ msgid "Insert into post"
2040
+ msgstr "Ubaci u post"
2041
+
2042
+ #: inc/post-metabox.php:22
2043
+ msgid "Gmedia Gallery MetaBox"
2044
+ msgstr "Gmedia Gallery MetaBox"
2045
+
2046
+ #: inc/post-metabox.php:53
2047
+ msgid "Gmedia"
2048
+ msgstr "Gmedia"
2049
+
2050
+ #: inc/post-metabox.php:81
2051
+ msgid "Initializing..."
2052
+ msgstr "Iniciranje..."
2053
+
2054
+ #: inc/post-metabox.php:82
2055
+ msgid "Choose text area first"
2056
+ msgstr "Prvo izaberite oblast teksta"
2057
+
2058
+ #: inc/post-metabox.php:120
2059
+ msgid "module"
2060
+ msgstr "modul"
2061
+
2062
+ #: inc/post-metabox.php:125
2063
+ msgid "click to remove shortcode"
2064
+ msgstr "kliknite da biste uklonili shortcode"
2065
+
2066
+ #: inc/post-metabox.php:130
2067
+ msgid "click to insert shortcode"
2068
+ msgstr "kliknite da biste uneli shortcode"
2069
+
2070
+ #: inc/post-metabox.php:137
2071
+ msgid "edit"
2072
+ msgstr "uredi"
2073
+
2074
+ #: inc/post-metabox.php:142
2075
+ msgid "No Galleries."
2076
+ msgstr "nema galerija"
2077
+
2078
+ #: inc/post-metabox.php:142
2079
+ msgid "Create"
2080
+ msgstr "Kreiraj"
2081
+
2082
+ #: inc/post-metabox.php:149
2083
+ msgid "Rate Gmedia at Wordpress.org"
2084
+ msgstr "Ocenite Gmedia na Wordpress.org"
2085
+
2086
+ #: inc/shortcodes.php:88
2087
+ msgid "Gmedia Module folder missed."
2088
+ msgstr "Nedostaje folder Gmedia Modul"
2089
+
2090
+ #: inc/shortcodes.php:100
2091
+ msgid "Module `%s` is outdated. Update module to latest version"
2092
+ msgstr "Modul `%s` je zastareo. Ažurirajte modul na najnoviju verziju"
2093
+
2094
+ #: inc/shortcodes.php:103
2095
+ msgid "Module `%s` is broken. Choose another module for this gallery"
2096
+ msgstr "Modul `%s` ne radi. Izaberite novi modul za galeriju."
2097
+
2098
+ #: inc/shortcodes.php:148 inc/shortcodes.php:152
2099
+ msgid "Choose gallery source, please."
2100
+ msgstr "Izaberite izvor galerije."
2101
+
2102
+ #: setup.php:38
2103
+ msgid "Abstract"
2104
+ msgstr "Izvod"
2105
+
2106
+ #: setup.php:39
2107
+ msgid "Animals"
2108
+ msgstr "Životinje"
2109
+
2110
+ #: setup.php:40
2111
+ msgid "Black and White"
2112
+ msgstr "Crno i belo"
2113
+
2114
+ #: setup.php:41
2115
+ msgid "Celebrities"
2116
+ msgstr "Slavne ličnosti"
2117
+
2118
+ #: setup.php:42
2119
+ msgid "City & Architecture"
2120
+ msgstr "Grad i arhitektura"
2121
+
2122
+ #: setup.php:43
2123
+ msgid "Commercial"
2124
+ msgstr "Reklame"
2125
+
2126
+ #: setup.php:44
2127
+ msgid "Concert"
2128
+ msgstr "Koncert"
2129
+
2130
+ #: setup.php:45
2131
+ msgid "Family"
2132
+ msgstr "Porodica"
2133
+
2134
+ #: setup.php:46
2135
+ msgid "Fashion"
2136
+ msgstr "Moda"
2137
+
2138
+ #: setup.php:47
2139
+ msgid "Film"
2140
+ msgstr "Film"
2141
+
2142
+ #: setup.php:48
2143
+ msgid "Fine Art"
2144
+ msgstr "Umetnost"
2145
+
2146
+ #: setup.php:49
2147
+ msgid "Food"
2148
+ msgstr "Hrana"
2149
+
2150
+ #: setup.php:50
2151
+ msgid "Journalism"
2152
+ msgstr "Žurnalizam"
2153
+
2154
+ #: setup.php:51
2155
+ msgid "Landscapes"
2156
+ msgstr "Predeli"
2157
+
2158
+ #: setup.php:52
2159
+ msgid "Macro"
2160
+ msgstr "Makro"
2161
+
2162
+ #: setup.php:53
2163
+ msgid "Nature"
2164
+ msgstr "Priroda"
2165
+
2166
+ #: setup.php:54
2167
+ msgid "Nude"
2168
+ msgstr "Obnaženo telo"
2169
+
2170
+ #: setup.php:55
2171
+ msgid "People"
2172
+ msgstr "Ljudi"
2173
+
2174
+ #: setup.php:56
2175
+ msgid "Performing Arts"
2176
+ msgstr "Izvođači"
2177
+
2178
+ #: setup.php:57
2179
+ msgid "Sport"
2180
+ msgstr "Sport"
2181
+
2182
+ #: setup.php:58
2183
+ msgid "Still Life"
2184
+ msgstr "Stil života"
2185
+
2186
+ #: setup.php:59
2187
+ msgid "Street"
2188
+ msgstr "Ulica"
2189
+
2190
+ #: setup.php:60
2191
+ msgid "Transportation"
2192
+ msgstr "Saobraćaj"
2193
+
2194
+ #: setup.php:61
2195
+ msgid "Travel"
2196
+ msgstr "Putovanja"
2197
+
2198
+ #: setup.php:62
2199
+ msgid "Underwater"
2200
+ msgstr "Podvodni svet"
2201
+
2202
+ #: setup.php:63
2203
+ msgid "Urban Exploration"
2204
+ msgstr "Istraživanje napuštenih građevina"
2205
+
2206
+ #: setup.php:64
2207
+ msgid "Wedding"
2208
+ msgstr "Venčanje"
2209
+
2210
+ #: setup.php:99
2211
+ msgid "Sorry, Gmedia Gallery works only with a role called administrator"
2212
+ msgstr ""
2213
+ "Žao nam je, Gmedia galerija radi samo sa ulogom koja se naziva administrator"
2214
+
2215
+ #: setup.php:225
2216
+ msgid ""
2217
+ "GmediaGallery: Tables could not created, please check your database settings"
2218
+ msgstr ""
2219
+ "Gmedia Galerija: Tabele nisu kreirane, proverite podešavanja baze podataka. "
2220
+
2221
+ #: update.php:12
2222
+ msgid ""
2223
+ "<strong>GmediaGallery Data Update Required</strong> &#8211; We need to "
2224
+ "update your install to the latest version."
2225
+ msgstr ""
2226
+ "<strong>GmediaGalerija Obavezno ažuriranje podataka</strong> &#8211; Treba "
2227
+ "da ažuriramo vašu instalaciju na najnoviju verziju."
2228
+
2229
+ #: update.php:14
2230
+ msgid ""
2231
+ "<strong>Important:</strong> &#8211; GmediaGallery plugin was fully "
2232
+ "rewritten, so after update you need to check all your created galleries and "
2233
+ "update modules."
2234
+ msgstr ""
2235
+ "<strong>Važno:</strong> &#8211; plugin Gmedia Galerija ponovo je napisan. "
2236
+ "Nakon ažuriranja treba da proverite kreirane galerije i da ažurirate module. "
2237
+
2238
+ #: update.php:16 update.php:35
2239
+ msgid "The update process may take a little while, so please be patient."
2240
+ msgstr "Proces ažuriranja može malo da potraje, budite strpljivi."
2241
+
2242
+ #: update.php:19
2243
+ msgid "Run the updater"
2244
+ msgstr "Pokrenite sistem za ažuriranje"
2245
+
2246
+ #: update.php:24
2247
+ msgid ""
2248
+ "It is strongly recommended that you backup your database before proceeding. "
2249
+ "Are you sure you wish to run the updater now?"
2250
+ msgstr ""
2251
+ "Savetujemo vam da napravite kopiju baze podataka pre nego što nastavite. "
2252
+ "Jeste li sigurni da želite sada da ažurirate?"
2253
+
2254
+ #: update.php:33
2255
+ msgid ""
2256
+ "<strong>Gme