Simple Image Sizes - Version 3.0.8

Version Description

Download this release

Release Info

Developer Rahe
Plugin Icon wp plugin Simple Image Sizes
Version 3.0.8
Comparing to
See all releases

Code changes from version 3.0.7 to 3.0.8

README CHANGED
@@ -1,204 +1,204 @@
1
- # Simple Image Sizes #
2
- **Contributors:** Rahe
3
-
4
- **Donate link:** http://www.beapi.fr/donate/
5
-
6
- **Tags:** images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate, cropping
7
-
8
- **Requires at least:** 3.5
9
-
10
- **Tested up to:** 4.2.1
11
-
12
- **Stable tag:** 3.0.6
13
-
14
-
15
- ## Description ##
16
-
17
- This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
18
- You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
19
- You can now get all the code to copy and paste to your function theme file.
20
- Now you can use the generated sizes directly into your posts and insert images at the right size !
21
- Now you choose if you want display the size in the post insert image.
22
- Now you can regenerate the images one by one in the 'Medias' general pane.
23
- Now you can regenerate the images by bulk action in the 'Medias' general pane.
24
- Now you can regenerate the image sizes on single attachment edit page.
25
-
26
- I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
27
- I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
28
-
29
- Contribute on https://github.com/Rahe/Simple-image-sizes
30
-
31
- ## Installation ##
32
- **PHP5 Required.**
33
-
34
- 1. Download, unzip and upload to your WordPress plugins directory
35
- 2. Activate the plugin within you WordPress Administration Backend
36
- 3. Go to Settings > Medias
37
- 4. Configure your new image sizes and regenerate the thumbnails !
38
-
39
-
40
- ## Frequently Asked Questions ##
41
-
42
- ### Where can I add image sizes ? ####
43
- Go to Settings -> Media then you can add a image size. You have to add a unique custom name without any spaces or special chars.
44
- The best is to use something like my-custom-size.
45
- Then you have several fields for configuring the image size, the widht, the height, cropping.
46
- And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
47
-
48
-
49
- ## Screenshots ##
50
-
51
- ###1. Settings page
52
- ###
53
- ![Settings page
54
- ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-1.png)
55
-
56
- ###2. Get PHP for the theme
57
- ###
58
- ![Get PHP for the theme
59
- ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-2.png)
60
-
61
- ###3. Choose the sizes to regenerate and regenerate them
62
- ###
63
- ![Choose the sizes to regenerate
64
- ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-3.png)
65
-
66
- ## Changelog ##
67
- * 3.0.7
68
- * Fix bug on single image regeneration upload page
69
- * Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
70
- * 3.0.6
71
- * Fix bug for the image adding
72
- * 3.0.5
73
- * Fix bug on condition
74
- * 3.0.4
75
- * Fix global add_image_size
76
- * 3.0.3
77
- * Add Hebrew translations thanks to Atar4U
78
- * 3.0.2
79
- * Fix version check for the image crop positions
80
- * Add Hebrew translations thanks to Atar4U
81
- * 3.0.1
82
- * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
83
- * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
84
- * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
85
- * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
86
- * 3.0
87
- * Revamping all the code, change classes and structure
88
- * Use grunt for compiling files
89
- * Handle the 3.9 new cropping position
90
- * Remove aristo css
91
- * Use UI from WordPress
92
- * 2.4.3
93
- * Remove some php notices
94
- * Remove notice when wrong image size
95
- * 2.4.2
96
- * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
97
- * 2.4.1
98
- * Remove function not working on admin file
99
- * 2.4
100
- * Made for 3.5 and up
101
- * Refactoring PHP/Javascript code
102
- * Javascript improvements
103
- * Remove useless UI
104
- * UI improvements
105
- * Global PHP performance improvements
106
- * 2.3.1
107
- * Add Ajax bulk actions on medias list
108
- * Add ajax thumbnail rebuild on single media
109
- * 2.3
110
- * Add the custom size name in the attachment insertion
111
- * Exclude post_type wich do not support the post-thumbnail feature
112
- * 2.2.5
113
- * Debug the regeneration buggy !
114
- * Complete the french translation
115
- * Security update for single regeneration, include the nonce this time :)
116
- * 2.2.4
117
- * Add security nonces for every actions
118
- * Put the messages at the begining of the log
119
- * Add a select all checkbox Thank to cocola
120
- * Add the german translation thanks to glueckpress
121
- * Remove notice tnahks to christianwach
122
- * Remove useless and buggy for my scripting pointers
123
- * 2.2.3
124
- * Do not force network usage
125
- * 2.2.2
126
- * Debug js for the buttons
127
- * Remove console.log calls
128
- * 2.2.1
129
- * Use buttonset for the checkboxes
130
- * Add Pointer for WordPress 3.3
131
- * Fix translation in French
132
- * Some medias queries for small windows ( change size of buttons and alignment )
133
- * 2.2
134
- * Add new version of css aristo
135
- * Add some icons
136
- * Display button for saving changes only when changes detected
137
- * Display message when a size is modified but not saved and wanted to regenerate
138
- * Debug functionnality when regenerating only some sizes, metas not crushed
139
- * Add solo regenerating
140
- * Remove displaying for theme/not theme sizes
141
- * Use WordPress class for small inputs
142
- * 2.1
143
- * Add javascript timer
144
- * Improve javascript and more IE friendly
145
- * You can now choose if you want to display the image sizes in image insertion or not
146
- * Handle errors and messages
147
- * Remove some css useless rules
148
- * Fix bad translation for french
149
- * Remove accents in image sizes
150
- * Do not update size properties if there is an ajax query for an another size name
151
- * 2.0.3
152
- * Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
153
- * 2.0.2
154
- * Remove debug on php for javascript
155
- * Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
156
- * 2.0.1
157
- * Resolve javascript issue when clicking on delete button
158
- * Resolve issue of never unchecking crop button
159
- * 2.0
160
- * Code refactoring
161
- * Update translations
162
- * Ajaxification of the process
163
- * Deleting by Ajax
164
- * Updating by Ajax
165
- * Adding by Ajax
166
- * Change UI
167
- * Change theme
168
- * Handle ajax errors
169
- * Handle not modified sizes, cropped
170
- * Handle same names
171
- * Sanitize the names
172
- * Customize jQuery ui
173
- * Customize jQuery ui theme
174
- * HTML5 Elements
175
- * CSS3 Animations
176
- * 1.0.6
177
- * Minify javascript names
178
- * Change progressbar style
179
- * Add animations on progressbar
180
- * 1.0.5
181
- * Only add css and js script in the media page to avoid any javascript error in other pages
182
- * Rectify css
183
- * Add function to get the code for the function.php file of the theme
184
- * Don't redefine the Wordpress basic size names
185
- * 1.0.4
186
- * Fix the add_image_size issue ( height and width reversed )
187
- * 1.0.3
188
- * Fix the plugin language
189
- * Add some translations
190
- * Externalise some css
191
- * Add sizes in the image adding to an article
192
- * Add setting link in the plugins list
193
- * Use admin_url instead of home_url
194
- * Add legend for colors
195
- * Some code refactoring
196
- * 1.0.2
197
- * Fix the plugin license
198
- * 1.0.1
199
- * Add POT file
200
- * Add french translation
201
- * 1.0
202
- * First release
203
- * Thumbnail regenerate
204
- * Image size generation
1
+ # Simple Image Sizes #
2
+ **Contributors:** Rahe
3
+
4
+ **Donate link:** http://www.beapi.fr/donate/
5
+
6
+ **Tags:** images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate, cropping
7
+
8
+ **Requires at least:** 3.5
9
+
10
+ **Tested up to:** 4.2.1
11
+
12
+ **Stable tag:** 3.0.6
13
+
14
+
15
+ ## Description ##
16
+
17
+ This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
18
+ You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
19
+ You can now get all the code to copy and paste to your function theme file.
20
+ Now you can use the generated sizes directly into your posts and insert images at the right size !
21
+ Now you choose if you want display the size in the post insert image.
22
+ Now you can regenerate the images one by one in the 'Medias' general pane.
23
+ Now you can regenerate the images by bulk action in the 'Medias' general pane.
24
+ Now you can regenerate the image sizes on single attachment edit page.
25
+
26
+ I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
27
+ I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
28
+
29
+ Contribute on https://github.com/Rahe/Simple-image-sizes
30
+
31
+ ## Installation ##
32
+ **PHP5 Required.**
33
+
34
+ 1. Download, unzip and upload to your WordPress plugins directory
35
+ 2. Activate the plugin within you WordPress Administration Backend
36
+ 3. Go to Settings > Medias
37
+ 4. Configure your new image sizes and regenerate the thumbnails !
38
+
39
+
40
+ ## Frequently Asked Questions ##
41
+
42
+ ### Where can I add image sizes ? ####
43
+ Go to Settings -> Media then you can add a image size. You have to add a unique custom name without any spaces or special chars.
44
+ The best is to use something like my-custom-size.
45
+ Then you have several fields for configuring the image size, the widht, the height, cropping.
46
+ And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
47
+
48
+
49
+ ## Screenshots ##
50
+
51
+ ###1. Settings page
52
+ ###
53
+ ![Settings page
54
+ ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-1.png)
55
+
56
+ ###2. Get PHP for the theme
57
+ ###
58
+ ![Get PHP for the theme
59
+ ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-2.png)
60
+
61
+ ###3. Choose the sizes to regenerate and regenerate them
62
+ ###
63
+ ![Choose the sizes to regenerate
64
+ ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-3.png)
65
+
66
+ ## Changelog ##
67
+ * 3.0.7
68
+ * Fix bug on single image regeneration upload page
69
+ * Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
70
+ * 3.0.6
71
+ * Fix bug for the image adding
72
+ * 3.0.5
73
+ * Fix bug on condition
74
+ * 3.0.4
75
+ * Fix global add_image_size
76
+ * 3.0.3
77
+ * Add Hebrew translations thanks to Atar4U
78
+ * 3.0.2
79
+ * Fix version check for the image crop positions
80
+ * Add Hebrew translations thanks to Atar4U
81
+ * 3.0.1
82
+ * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
83
+ * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
84
+ * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
85
+ * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
86
+ * 3.0
87
+ * Revamping all the code, change classes and structure
88
+ * Use grunt for compiling files
89
+ * Handle the 3.9 new cropping position
90
+ * Remove aristo css
91
+ * Use UI from WordPress
92
+ * 2.4.3
93
+ * Remove some php notices
94
+ * Remove notice when wrong image size
95
+ * 2.4.2
96
+ * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
97
+ * 2.4.1
98
+ * Remove function not working on admin file
99
+ * 2.4
100
+ * Made for 3.5 and up
101
+ * Refactoring PHP/Javascript code
102
+ * Javascript improvements
103
+ * Remove useless UI
104
+ * UI improvements
105
+ * Global PHP performance improvements
106
+ * 2.3.1
107
+ * Add Ajax bulk actions on medias list
108
+ * Add ajax thumbnail rebuild on single media
109
+ * 2.3
110
+ * Add the custom size name in the attachment insertion
111
+ * Exclude post_type wich do not support the post-thumbnail feature
112
+ * 2.2.5
113
+ * Debug the regeneration buggy !
114
+ * Complete the french translation
115
+ * Security update for single regeneration, include the nonce this time :)
116
+ * 2.2.4
117
+ * Add security nonces for every actions
118
+ * Put the messages at the begining of the log
119
+ * Add a select all checkbox Thank to cocola
120
+ * Add the german translation thanks to glueckpress
121
+ * Remove notice tnahks to christianwach
122
+ * Remove useless and buggy for my scripting pointers
123
+ * 2.2.3
124
+ * Do not force network usage
125
+ * 2.2.2
126
+ * Debug js for the buttons
127
+ * Remove console.log calls
128
+ * 2.2.1
129
+ * Use buttonset for the checkboxes
130
+ * Add Pointer for WordPress 3.3
131
+ * Fix translation in French
132
+ * Some medias queries for small windows ( change size of buttons and alignment )
133
+ * 2.2
134
+ * Add new version of css aristo
135
+ * Add some icons
136
+ * Display button for saving changes only when changes detected
137
+ * Display message when a size is modified but not saved and wanted to regenerate
138
+ * Debug functionnality when regenerating only some sizes, metas not crushed
139
+ * Add solo regenerating
140
+ * Remove displaying for theme/not theme sizes
141
+ * Use WordPress class for small inputs
142
+ * 2.1
143
+ * Add javascript timer
144
+ * Improve javascript and more IE friendly
145
+ * You can now choose if you want to display the image sizes in image insertion or not
146
+ * Handle errors and messages
147
+ * Remove some css useless rules
148
+ * Fix bad translation for french
149
+ * Remove accents in image sizes
150
+ * Do not update size properties if there is an ajax query for an another size name
151
+ * 2.0.3
152
+ * Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
153
+ * 2.0.2
154
+ * Remove debug on php for javascript
155
+ * Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
156
+ * 2.0.1
157
+ * Resolve javascript issue when clicking on delete button
158
+ * Resolve issue of never unchecking crop button
159
+ * 2.0
160
+ * Code refactoring
161
+ * Update translations
162
+ * Ajaxification of the process
163
+ * Deleting by Ajax
164
+ * Updating by Ajax
165
+ * Adding by Ajax
166
+ * Change UI
167
+ * Change theme
168
+ * Handle ajax errors
169
+ * Handle not modified sizes, cropped
170
+ * Handle same names
171
+ * Sanitize the names
172
+ * Customize jQuery ui
173
+ * Customize jQuery ui theme
174
+ * HTML5 Elements
175
+ * CSS3 Animations
176
+ * 1.0.6
177
+ * Minify javascript names
178
+ * Change progressbar style
179
+ * Add animations on progressbar
180
+ * 1.0.5
181
+ * Only add css and js script in the media page to avoid any javascript error in other pages
182
+ * Rectify css
183
+ * Add function to get the code for the function.php file of the theme
184
+ * Don't redefine the Wordpress basic size names
185
+ * 1.0.4
186
+ * Fix the add_image_size issue ( height and width reversed )
187
+ * 1.0.3
188
+ * Fix the plugin language
189
+ * Add some translations
190
+ * Externalise some css
191
+ * Add sizes in the image adding to an article
192
+ * Add setting link in the plugins list
193
+ * Use admin_url instead of home_url
194
+ * Add legend for colors
195
+ * Some code refactoring
196
+ * 1.0.2
197
+ * Fix the plugin license
198
+ * 1.0.1
199
+ * Add POT file
200
+ * Add french translation
201
+ * 1.0
202
+ * First release
203
+ * Thumbnail regenerate
204
+ * Image size generation
assets/css/sis-style.css CHANGED
@@ -1,62 +1,62 @@
1
- .media-item.sis {
2
- display: none;
3
- }
4
- .media-item.sis .progress {
5
- width: 100%;
6
- }
7
- input.h, input.w {
8
- border-color: #DFDFDF;
9
- background-color: white;
10
- border-width: 1px;
11
- border-style: solid;
12
- -moz-border-radius: 3px;
13
- -khtml-border-radius: 3px;
14
- -webkit-border-radius: 3px;
15
- border-radius: 3px;
16
- }
17
- table.sis tr {
18
- -webkit-transition: all .5s ease-in-out;
19
- -moz-transition: all .5s ease-in-out;
20
- -o-transition: all .5s ease-in-out;
21
- transition: all .5s ease-in-out;
22
- }
23
- table.sis tr:nth-child(even) {
24
- background-color: #FCFCFC;
25
- }
26
- table.sis tr:nth-child(odd) {
27
- background-color: transparent;
28
- }
29
- tr.addPending {
30
- background-color: #6CA1D7;
31
- }
32
- tr.successAdding {
33
- background-color: #89D76A;
34
- }
35
- tr.errorAdding {
36
- background-color: #C45858;
37
- }
38
- tr.notChangedAdding {
39
- background-color: #F2A13A;
40
- }
41
- .sis .regenerate_message,
42
- .sis .time,
43
- .sis .thumb {
44
- display: none;
45
- }
46
-
47
- #ajax_thumbnail_rebuild {
48
- margin-top: 40px;
49
- }
50
- #sis_progress-percent {
51
- width: 100%;
52
- text-align: center;
53
- font-weight: bold;
54
- }
55
-
56
- .sis .time .ui-state-highlight{
57
- margin-top: 20px;
58
- padding: 0 .7em;
59
- }
60
- #post-body .sis-regenerate-one{
61
- float:left;
62
- }
1
+ .media-item.sis {
2
+ display: none;
3
+ }
4
+ .media-item.sis .progress {
5
+ width: 100%;
6
+ }
7
+ input.h, input.w {
8
+ border-color: #DFDFDF;
9
+ background-color: white;
10
+ border-width: 1px;
11
+ border-style: solid;
12
+ -moz-border-radius: 3px;
13
+ -khtml-border-radius: 3px;
14
+ -webkit-border-radius: 3px;
15
+ border-radius: 3px;
16
+ }
17
+ table.sis tr {
18
+ -webkit-transition: all .5s ease-in-out;
19
+ -moz-transition: all .5s ease-in-out;
20
+ -o-transition: all .5s ease-in-out;
21
+ transition: all .5s ease-in-out;
22
+ }
23
+ table.sis tr:nth-child(even) {
24
+ background-color: #FCFCFC;
25
+ }
26
+ table.sis tr:nth-child(odd) {
27
+ background-color: transparent;
28
+ }
29
+ tr.addPending {
30
+ background-color: #6CA1D7;
31
+ }
32
+ tr.successAdding {
33
+ background-color: #89D76A;
34
+ }
35
+ tr.errorAdding {
36
+ background-color: #C45858;
37
+ }
38
+ tr.notChangedAdding {
39
+ background-color: #F2A13A;
40
+ }
41
+ .sis .regenerate_message,
42
+ .sis .time,
43
+ .sis .thumb {
44
+ display: none;
45
+ }
46
+
47
+ #ajax_thumbnail_rebuild {
48
+ margin-top: 40px;
49
+ }
50
+ #sis_progress-percent {
51
+ width: 100%;
52
+ text-align: center;
53
+ font-weight: bold;
54
+ }
55
+
56
+ .sis .time .ui-state-highlight{
57
+ margin-top: 20px;
58
+ padding: 0 .7em;
59
+ }
60
+ #post-body .sis-regenerate-one{
61
+ float:left;
62
+ }
assets/js/sis-attachments.js CHANGED
@@ -1,108 +1,108 @@
1
- // Functions for the regenerating of images
2
- var sis;
3
- if( !sis ) {
4
- sis = {};
5
- } else if( typeof sis !== "object" ) {
6
- throw new Error( 'sis already exists and not an object' );
7
- }
8
-
9
- jQuery( function() {
10
- 'use strict';
11
- var bdy = jQuery( document.body ), SISAttachRegenerate = null, sis_obj = null;
12
- // Add action dinamycally
13
- jQuery( 'select[name="action"], select[name="action2"]' ).append(
14
- jQuery( '<option/>' ).attr( 'value', 'sis-regenerate' ).text( sis.regenerate )
15
- );
16
-
17
- // Regenerate one element
18
- bdy.on( 'click', '.sis-regenerate-one', function( e ) {
19
- e.preventDefault();
20
- sis_obj = new SISAttachRegenerate( this );
21
- });
22
-
23
- // On bulk actions
24
- jQuery( '#doaction, #doaction2' ).on( 'click', function( e ) {
25
- if( jQuery( this ).parent().find( 'select' ).val() === 'sis-regenerate' ) {
26
- // Get checked checkbocxes
27
- var els = jQuery( '#the-list .check-column input[type="checkbox"]:checked' ).closest( 'tr' ).find( '.sis-regenerate-one' );
28
-
29
- // Check there is any elements selected
30
- if( els.length > 0 ) {
31
-
32
- // Stop default action
33
- e.preventDefault();
34
-
35
- // Make all the selected elements
36
- els.each( function( i,el ) {
37
- sis_obj = new SISAttachRegenerate( this );
38
- } );
39
- }
40
- }
41
- } );
42
-
43
- // Function for regenerating the elements
44
- SISAttachRegenerate = function( el ) {
45
- var regenerate = {
46
- list : {},
47
- parent : null,
48
- el : null,
49
- id : null,
50
- messageZone : '',
51
- init: function( el ) {
52
- this.el = el;
53
- this.parent = el.closest( 'tr' );
54
- this.id = this.el.data( 'id' );
55
- this.list = { 'id' : this.id, 'title' : '' };
56
- this.messageZone = this.parent.find( '.title em' );
57
-
58
- if( this.parent.find( '.title em' ).length === 0 ) {
59
- this.parent.find( '.title strong' ).after( '<em/>' );
60
- }
61
-
62
- this.messageZone = this.parent.find( '.title em' );
63
-
64
- if( !this.parent.hasClass( 'ajaxing' ) ) {
65
- this.regenItem();
66
- }
67
- },
68
- setMessage : function( msg ) {
69
- // Display the message
70
- this.messageZone.html( ' - '+ msg ).addClass( 'updated' ).addClass( 'fade' ).show();
71
- },
72
- regenItem : function( ) {
73
- var self = this;
74
-
75
- jQuery.ajax( {
76
- url: sis.ajaxUrl,
77
- type: "POST",
78
- dataType: 'json',
79
- cache: false,
80
- data: {
81
- action : 'sis_rebuild_image',
82
- id : this.list.id,
83
- nonce : sis.regen_one
84
- },
85
- beforeSend : function() {
86
- self.parent.addClass( 'ajaxing' ).find( '.sis-regenerate-one' ).hide().end().find('.spinner').show();
87
- self.parent.find( 'a.sis-regenerate-one' ).closest( 'tr' ).fadeTo( 'fast', '0.3' );
88
- },
89
- success: function( r ) {
90
- var message ='';
91
- // Check if error or a message in response
92
- if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
93
- message = typeof r !== 'object' ? message = sis.phpError : r.error ;
94
- } else {
95
- message = sis.soloRegenerated.replace( '%s', r.time );
96
- }
97
- self.setMessage( message );
98
- self.parent.removeClass( 'ajaxing' ).find( '.sis-regenerate-one' ).show().end().find('.spinner').hide();
99
- self.parent.find( 'a.sis-regenerate-one' ).closest( 'tr' ).fadeTo( 'fast', '1' );
100
- }
101
- });
102
- }
103
- };
104
-
105
- // Launch regeneration
106
- regenerate.init( jQuery( el ) );
107
- };
108
  } );
1
+ // Functions for the regenerating of images
2
+ var sis;
3
+ if( !sis ) {
4
+ sis = {};
5
+ } else if( typeof sis !== "object" ) {
6
+ throw new Error( 'sis already exists and not an object' );
7
+ }
8
+
9
+ jQuery( function() {
10
+ 'use strict';
11
+ var bdy = jQuery( document.body ), SISAttachRegenerate = null, sis_obj = null;
12
+ // Add action dinamycally
13
+ jQuery( 'select[name="action"], select[name="action2"]' ).append(
14
+ jQuery( '<option/>' ).attr( 'value', 'sis-regenerate' ).text( sis.regenerate )
15
+ );
16
+
17
+ // Regenerate one element
18
+ bdy.on( 'click', '.sis-regenerate-one', function( e ) {
19
+ e.preventDefault();
20
+ sis_obj = new SISAttachRegenerate( this );
21
+ });
22
+
23
+ // On bulk actions
24
+ jQuery( '#doaction, #doaction2' ).on( 'click', function( e ) {
25
+ if( jQuery( this ).parent().find( 'select' ).val() === 'sis-regenerate' ) {
26
+ // Get checked checkbocxes
27
+ var els = jQuery( '#the-list .check-column input[type="checkbox"]:checked' ).closest( 'tr' ).find( '.sis-regenerate-one' );
28
+
29
+ // Check there is any elements selected
30
+ if( els.length > 0 ) {
31
+
32
+ // Stop default action
33
+ e.preventDefault();
34
+
35
+ // Make all the selected elements
36
+ els.each( function( i,el ) {
37
+ sis_obj = new SISAttachRegenerate( this );
38
+ } );
39
+ }
40
+ }
41
+ } );
42
+
43
+ // Function for regenerating the elements
44
+ SISAttachRegenerate = function( el ) {
45
+ var regenerate = {
46
+ list : {},
47
+ parent : null,
48
+ el : null,
49
+ id : null,
50
+ messageZone : '',
51
+ init: function( el ) {
52
+ this.el = el;
53
+ this.parent = el.closest( 'tr' );
54
+ this.id = this.el.data( 'id' );
55
+ this.list = { 'id' : this.id, 'title' : '' };
56
+ this.messageZone = this.parent.find( '.title em' );
57
+
58
+ if( this.parent.find( '.title em' ).length === 0 ) {
59
+ this.parent.find( '.title strong' ).after( '<em/>' );
60
+ }
61
+
62
+ this.messageZone = this.parent.find( '.title em' );
63
+
64
+ if( !this.parent.hasClass( 'ajaxing' ) ) {
65
+ this.regenItem();
66
+ }
67
+ },
68
+ setMessage : function( msg ) {
69
+ // Display the message
70
+ this.messageZone.html( ' - '+ msg ).addClass( 'updated' ).addClass( 'fade' ).show();
71
+ },
72
+ regenItem : function( ) {
73
+ var self = this;
74
+
75
+ jQuery.ajax( {
76
+ url: sis.ajaxUrl,
77
+ type: "POST",
78
+ dataType: 'json',
79
+ cache: false,
80
+ data: {
81
+ action : 'sis_rebuild_image',
82
+ id : this.list.id,
83
+ nonce : sis.regen_one
84
+ },
85
+ beforeSend : function() {
86
+ self.parent.addClass( 'ajaxing' ).find( '.sis-regenerate-one' ).hide().end().find('.spinner').show();
87
+ self.parent.find( 'a.sis-regenerate-one' ).closest( 'tr' ).fadeTo( 'fast', '0.3' );
88
+ },
89
+ success: function( r ) {
90
+ var message ='';
91
+ // Check if error or a message in response
92
+ if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
93
+ message = typeof r !== 'object' ? message = sis.phpError : r.error ;
94
+ } else {
95
+ message = sis.soloRegenerated.replace( '%s', r.time );
96
+ }
97
+ self.setMessage( message );
98
+ self.parent.removeClass( 'ajaxing' ).find( '.sis-regenerate-one' ).show().end().find('.spinner').hide();
99
+ self.parent.find( 'a.sis-regenerate-one' ).closest( 'tr' ).fadeTo( 'fast', '1' );
100
+ }
101
+ });
102
+ }
103
+ };
104
+
105
+ // Launch regeneration
106
+ regenerate.init( jQuery( el ) );
107
+ };
108
  } );
assets/js/sis.js CHANGED
@@ -1,579 +1,579 @@
1
- // Functions for the regenerating of images
2
- var rahe;
3
- if( !rahe ) {
4
- rahe = {};
5
- } else if( typeof rahe !== "object" ) {
6
- throw new Error( 'rahe already exists and not an object' );
7
- }
8
-
9
- if( !rahe.sis ) {
10
- rahe.sis = {};
11
- } else if( typeof rahe.sis !== "object" ) {
12
- throw new Error( 'rahe.sis already exists and not an object' );
13
- }
14
-
15
- rahe.sis.regenerate = {
16
- post_types : [],
17
- thumbnails : [],
18
- total : 0,
19
- cur : 0,
20
- timeScript: [],
21
- dateScript: '',
22
- percent : '' ,
23
- percentText : null,
24
- progress : null,
25
- messageZone : null,
26
- sisZone : null,
27
- time : null,
28
- timeZone : null,
29
- buttonRegenerate : null,
30
- errorZone : null,
31
- errorMessages : null,
32
- thumb : null,
33
- thumbImg : null,
34
- init : function() {
35
- this.sisZone = jQuery('.sis');
36
- this.percentText = jQuery('#sis_progress-percent');
37
- this.progress = jQuery( '.progress' );
38
- this.messageZone = this.sisZone.find(".regenerate_message");
39
- this.time = this.sisZone.find(".time");
40
- this.timeZone = this.time.find("p span.time_message");
41
- this.buttonRegenerate = jQuery( "#ajax_thumbnail_rebuild" );
42
- this.errorZone = jQuery( '#error_messages' );
43
- this.errorMessages = this.errorZone.find( 'ul.messages' );
44
- this.thumb = this.sisZone.find( '.thumb' );
45
- this.thumbImg = this.sisZone.find( '.thumb-img' );
46
- },
47
- getThumbnails : function() {
48
- var self = this,
49
- inputs = jQuery( 'input.thumbnails:checked' );
50
-
51
- // Get the checked thumbnails inputs
52
- if (inputs.length != jQuery( 'input.thumbnails[type="checkbox"]' ).length) {
53
- inputs.each( function( i ) {
54
- self.thumbnails.push( this.value );
55
- });
56
- }
57
- },
58
- getPostTypes : function() {
59
- var self = this,
60
- inputs = jQuery( 'input.post_types:checked' );
61
-
62
- // Get the checked post Types inputs
63
- if ( inputs.length != jQuery( 'input.post_types[type="checkbox"]' ).length ) {
64
- inputs.each( function() {
65
- self.post_types.push( this.value );
66
- } );
67
- }
68
- },
69
- setMessage : function( msg ) {
70
- // Display the message
71
- this.messageZone.html( "<p>" + msg + "</p>" ).addClass( 'updated' ).addClass( 'fade' ).show();
72
- },
73
- setTimeMessage : function ( msg ) {
74
- this.timeZone.html( msg );
75
- },
76
- checkStartRegenerating : function(){
77
- if( jQuery( '.notSaved' ).size() > 0 ) {
78
- var confirmation = confirm( sis.notSaved );
79
-
80
- // Delete if ok else not delete
81
- if( confirmation == true ) {
82
- this.startRegenerating();
83
- } else {
84
- return false;
85
- }
86
- } else {
87
- this.startRegenerating();
88
- }
89
- },
90
- startRegenerating : function( ) {
91
- var self = this,
92
- wp_nonce = jQuery('input.getList').val();
93
-
94
- // Get the humbnails and post types
95
- self.getThumbnails();
96
- self.getPostTypes();
97
-
98
- this.dateScript = new Date();
99
- // Start ajax
100
- jQuery.ajax( {
101
- url: sis.ajaxUrl,
102
- type: "POST",
103
- dataType: 'json',
104
- data: {
105
- action : 'sis_get_list',
106
- post_types : self.post_types,
107
- nonce : wp_nonce
108
- },
109
- beforeSend: function() {
110
-
111
- // Disable the button
112
- self.buttonRegenerate.attr( "disabled", true );
113
- // Display the message
114
- self.setMessage( sis.reading );
115
-
116
- },
117
- success: function( r ) {
118
-
119
- if( typeof r !== 'object' ) {
120
- self.reInit();
121
- self.setMessage( sis.phpError );
122
- return false;
123
- }
124
-
125
- self.time.show();
126
-
127
- // Eval the response
128
- self.total = r.total ;
129
-
130
- // Set the current to 0
131
- self.curr = 0;
132
-
133
- // Display the progress Bar
134
- self.progress.show().parent().show();
135
-
136
- // Start Regenerating
137
- self.regenItem();
138
- }
139
- });
140
- },
141
- regenItem : function( ) {
142
- var self = this,
143
- wp_nonce = jQuery('input.regen').val();
144
-
145
- // If the list is empty display the message of emptyness and reinitialize the form
146
- if ( this.total == 0 || _.isUndefined( this.total ) ) {
147
- this.reInit();
148
- this.setMessage( sis.noMedia );
149
- return false;
150
- }
151
-
152
- // If we have finished the regeneration display message and init again
153
- if ( this.curr >= this.total ) {
154
- var now = new Date();
155
- this.reInit();
156
- this.setMessage( sis.done+this.curr+' '+sis.messageRegenerated+sis.startedAt+' '+this.dateScript.getHours()+":"+this.dateScript.getMinutes()+":"+this.dateScript.getSeconds()+sis.finishedAt+' '+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds() );
157
- return;
158
- }
159
-
160
- // Set the message of current image regenerating
161
- this.setMessage( sis.regenerating + ( this.curr + 1 ) + sis.of + this.total );
162
- this.setMessage( sis.regenerating + ( this.curr + 1 ) + sis.of + this.total );
163
-
164
- jQuery.ajax( {
165
- url: sis.ajaxUrl,
166
- type: "POST",
167
- dataType: 'json',
168
- data: {
169
- action : 'sis_rebuild_images',
170
- offset : this.curr,
171
- thumbnails : this.thumbnails,
172
- nonce : wp_nonce
173
- },
174
- beforeSend : function() {
175
- // Calculate the percentage of regeneration
176
- self.percent = ( self.curr / self.total ) * 100;
177
-
178
- // Change the progression
179
- self.progress.find( '.bar' ).width( self.percent+'%' )
180
- .find('.percent').html( self.percent + '%' );
181
-
182
- // Change the text of progression
183
- self.percentText.removeClass( 'hidden' ).html( Math.round( self.percent ) + "%");
184
- },
185
- success: function( r ) {
186
- // Check if error or a message in response
187
- if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
188
- var message ='';
189
- if( typeof r !== 'object' ) {
190
- message = sis.phpError;
191
- } else {
192
- message = r.error
193
- }
194
-
195
- self.errorZone.addClass( 'error message' );
196
- self.errorMessages.prepend( '<li>'+message+'</li>' );
197
- } else {
198
-
199
- // Append a message if needed
200
- if( r.message ) {
201
- self.time.find( 'ul.messages' ).prepend( '<li>'+r.message+'</li>' );
202
- }
203
-
204
- // Display the image
205
- self.thumb.show();
206
-
207
- // Change his attribute
208
- self.thumbImg.attr("src", r.src);
209
-
210
- // Actual time
211
- var dateEnd = new Date(),
212
- curDate = new Date(),
213
- num = 0,
214
- sum = 0,
215
- i = 0,
216
- ave = 0,
217
- time = '';
218
-
219
- // Add the regenerating time to the array
220
- self.timeScript.push( parseFloat( r.time.replace( ',', '.' ), 10 ) );
221
-
222
- // Get the number of elements in array
223
- num = self.timeScript.length;
224
-
225
- // Make the sum of the times
226
- for( i; i < num ; i++ ) {
227
- sum += self.timeScript[i];
228
- }
229
-
230
- // Make the average value of the regenerating time
231
- ave = sum/num,
232
-
233
- // Round the value in miliseconds and add 25% or error
234
- t = Math.round( ( ( ave * self.total ) * 1000 ) );
235
-
236
- // Set the predicted time
237
- dateEnd.setTime( self.dateScript.getTime() + t );
238
-
239
- // Get the difference between the two dates
240
- time = self.s2t( Math.abs( ( dateEnd.getTime() - curDate.getTime() ) ) / 1000 );
241
-
242
- // Set the message in the notice box
243
- self.setTimeMessage( dateEnd.getHours()+":"+dateEnd.getMinutes()+":"+dateEnd.getSeconds()+sis.or+time+sis.beforeEnd );
244
- }
245
-
246
- // Inscrease the counter and regene the next item
247
- self.curr++;
248
- self.regenItem();
249
- }
250
- });
251
-
252
- },
253
- s2t : function (secs) {
254
- var secs = secs % 86400,
255
- t = new Date(1970,0,1),
256
- s = 0;
257
-
258
- t.setSeconds(secs);
259
- s = t.toTimeString().substr(0,8);
260
- if( secs > 86399 ) {
261
- s = Math.floor( ( t - Date.parse( "1/1/70" ) ) / 3600000 ) + s.substr( 2 );
262
- }
263
- return s;
264
- },
265
- reInit: function() {
266
- // Re initilize the form
267
- this.buttonRegenerate.removeAttr( "disabled" );
268
- this.thumb.hide();
269
- this.progress.hide();
270
- this.percentText.addClass( 'hidden' );
271
- }
272
- };
273
-
274
- rahe.sis.sizes = {
275
- i: 0,
276
- add: function(e,el) {
277
- e.preventDefault();
278
-
279
- // Create the template
280
- var elTr = rahe.sis.template( 'new_size' );
281
- elTr = elTr( {
282
- size_id : this.i,
283
- validate : sis.validate
284
- } );
285
-
286
- // Add the form for editing
287
- jQuery(el).closest( 'tr' ).before( elTr );
288
-
289
- // Inscrease the identifier
290
- this.i++;
291
- },
292
- register: function( e, el ) {
293
- // Stop propagation
294
- e.preventDefault();
295
-
296
- // Get name and id
297
- var name = jQuery(el).closest('tr').children( 'th' ).find( 'input' ).val(),
298
- id = jQuery(el).closest('tr').children('th').find( 'input' ).attr( 'id' ),
299
-
300
- // Get the number of elements with this name
301
- checkPresent = jQuery( el ).closest('tbody').find( 'input[value="'+name+'"]' ).length;
302
-
303
- // Check if not basic size or already present, display message
304
- if( name == 'thumbnail' || name == "medium" || name == "large" ) {
305
- alert( sis.notOriginal );
306
- return false;
307
- } else if( checkPresent !=0 ) {
308
- alert( sis.alreadyPresent );
309
- return false;
310
- }
311
-
312
- var row = rahe.sis.template( 'new_size_row' );
313
-
314
- row = row( {
315
- size : sis.size,
316
- size_name : name,
317
- maximumWidth : sis.maximumWidth,
318
- maximumHeight : sis.maximumHeight,
319
- customName : sis.customName,
320
- crop : sis.crop,
321
- crop_positions :sis.crop_positions,
322
- show : sis.show,
323
- deleteImage : sis.deleteImage,
324
- validateButton : sis.validateButton
325
- } );
326
-
327
- // Add the row to the current list
328
- jQuery('#' + id).closest( 'tr' ).html( row );
329
- },
330
- deleteSize: function( e, el ) {
331
- e.preventDefault();
332
- // Check if user want to delete or not
333
- var confirmation = confirm( sis.confirmDelete );
334
-
335
- // Delete if ok else not delete
336
- if( confirmation == true ) {
337
- // Remove from the list and the array
338
- jQuery( el ).closest( 'tr' ).remove();
339
- this.ajaxUnregister( el );
340
- }
341
- },
342
- getPhp : function( e, el ) {
343
- e.preventDefault();
344
- // Get parent element
345
- var parent = jQuery( el ).closest( 'tr' );
346
-
347
- jQuery.ajax( {
348
- url: sis.ajaxUrl,
349
- type: "POST",
350
- data: { action : "sis_get_sizes" },
351
- beforeSend: function() {
352
- // Remove classes of status
353
- parent.removeClass( 'addPending' );
354
- parent.addClass( 'addPending' );
355
- },
356
- success: function( result ) {
357
- // Add the classes for the status
358
- jQuery( '#get_php' ).nextAll( 'code' ).html( '<br />' + result).show().css( { 'display' : 'block' } );
359
- parent.removeClass( 'addPending' );
360
- }
361
- } );
362
- },
363
- ajaxRegister: function( e, el ) {
364
- e.preventDefault();
365
-
366
- // Get the vars
367
- var self = this,
368
- parentTable = jQuery( el ).closest( 'table' ),
369
- timer,
370
- wp_nonce = jQuery( '.addSize' ).val(),
371
- parent = jQuery( el ).closest( 'tr' ),
372
- n = parent.find( 'input[name="image_name"]' ).val(),
373
- c = parent.find( 'select.crop' ).val(),
374
- s = parent.find( 'input.show' ).val(),
375
- cn = parent.find( 'input.n' ).val(),
376
- h = 0,
377
- w = 0;
378
- s = ( s == false || s == undefined ) ? false : true ;
379
- w = parseInt( parent.find( 'input.w' ).val() );
380
- h = parseInt( parent.find( 'input.h' ).val() );
381
-
382
- if( !parentTable.hasClass( 'ajaxing' ) ) {
383
- jQuery.ajax({
384
- url: sis.ajaxUrl,
385
- type: "POST",
386
- dataType :'json',
387
- data: { action : "sis_add_size", width: w, height: h, crop: c, name: n, show: s, customName : cn , nonce : wp_nonce },
388
- beforeSend: function() {
389
- // Remove status and set pending
390
- parent.removeClass();
391
- parent.addClass( 'addPending' );
392
- parentTable.addClass( 'ajaxing' );
393
- },
394
- success: function(result) {
395
- // Set basic class and remove pending
396
- var classTr = '';
397
- parent.removeClass();
398
- parentTable.removeClass( 'ajaxing' )
399
-
400
- // Check the result for the different messages
401
- if( result == 0 ) {
402
- classTr = 'errorAdding';
403
- } else if( result == 2 ) {
404
- classTr = 'notChangedAdding';
405
-
406
- // add/update to the array with the status class
407
- self.addToArray( n, w, h, c, classTr );
408
- } else {
409
- classTr = 'successAdding';
410
-
411
- // add/update to the array with the status class
412
- self.addToArray( n, w, h, c, classTr );
413
- }
414
-
415
- // Add the new sizes values for checking of changed or not
416
- parent.find( 'input.h' ).attr( { base_h : h } );
417
- parent.find( 'input.w' ).attr( { base_w : w } );
418
- parent.find( 'select.c' ).attr( { base_c : c } );
419
- parent.find( 'input.s' ).attr( { base_s : s } );
420
-
421
- // Add the generated class
422
- parent.addClass( classTr );
423
- parent.find( 'td' ).removeClass( "notSaved" );
424
-
425
- // Change the button text
426
- parent.find( '.add_size' ).removeClass('validate_size').hide().children('.ui-button-text' ).text( sis.update ) ;
427
-
428
- clearTimeout( timer );
429
- // Remove classes after 3 seconds
430
- timer = setTimeout(function() {
431
- parent.removeClass( 'errorAdding notChangedAdding successAdding' );
432
- }, 2 * 1000 );
433
- }
434
- });
435
- }
436
- },
437
- ajaxUnregister: function( el ) {
438
- // Get name and self object
439
- var self = this,
440
- n = jQuery( el ).closest('tr').find( 'input[name="image_name"]' ).val(),
441
- wp_nonce = jQuery( el ).closest('tr').find( 'input.deleteSize' ).val();
442
-
443
- // Make the ajax call
444
- jQuery.ajax({
445
- url: sis.ajaxUrl,
446
- type: "POST",
447
- data: { action : "sis_remove_size", name: n, nonce : wp_nonce },
448
- success: function(result) {
449
- self.removeFromArray( el );
450
- }
451
- });
452
- },
453
- addToArray: function( n, w, h, c, s ) {
454
- // Get the row for editing or updating
455
- var testRow = jQuery( '#sis-'+n ),
456
- newRow = '',
457
- timer;
458
-
459
- // Get the right newRow, updating or adding ?
460
- if( testRow.length != 0 ) {
461
- newRow = testRow.closest( 'tr' );
462
- } else {
463
- newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone().attr( 'id', 'sis-'+n );
464
- }
465
-
466
- c = !_.isUndefined( sis.crop_positions[c] ) ? sis.crop_positions[c] : sis.fl ;
467
-
468
- // Set the datas with the given datas
469
- newRow.find( 'th > label' ).attr( 'for', n )
470
- .end()
471
- .find( 'input.thumbnails' ).val( n ).attr( 'id', n )
472
- .end()
473
- .find( 'th:nth-child(2) > label' ).text( n )
474
- .end()
475
- .find( 'th:nth-child(3) > label' ).text( w+'px' )
476
- .end()
477
- .find( 'th:nth-child(4) > label' ).text( h+'px' )
478
- .end()
479
- .find( 'th:nth-child(5) > label' ).text( c );
480
-
481
- // If new then add the row
482
- if( testRow.length == 0 ) {
483
- newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
484
- }
485
-
486
- // Remove the previous status classes and add the status class
487
- newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
488
-
489
- clearTimeout( timer );
490
- // Remove the statuses classes
491
- timer = setTimeout(function() {
492
- newRow.removeClass( 'errorAdding notChangedAdding successAdding' );
493
- }, 3 * 1000 );
494
- },
495
- removeFromArray: function( el ) {
496
- // get the name
497
- var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
498
-
499
- // Remove the given name from the array
500
- jQuery( '#sis-'+n ).remove();
501
- },
502
- displayChange : function( el ) {
503
- var el = jQuery( el ),
504
- parent = el.closest( 'tr' );
505
-
506
- // Check not new size
507
- if( parent.hasClass( 'new_size' ) ) {
508
- return false;
509
- }
510
-
511
- var h_el = parent.find( 'input.h' ),
512
- w_el = parent.find( 'input.w' ),
513
- c_el = parent.find( 'select.c' ),
514
- s_el = parent.find( 'input.s' ),
515
- n_el = parent.find( 'input.n' ),
516
-
517
- h = h_el.val(),
518
- w = w_el.val(),
519
- c = c_el.val(),
520
- s = s_el.val(),
521
- n = n_el.val(),
522
-
523
- base_h = h_el.attr( 'base_h' ),
524
- base_w = w_el.attr( 'base_w' ),
525
- base_c = c_el.attr( 'base_c' ),
526
- base_s = s_el.attr( 'base_s' ),
527
- base_n = n_el.attr( 'base_n' );
528
-
529
-
530
- base_c = base_c == '0' ? false : true;
531
- base_s = base_s == '0' ? false : true;
532
-
533
- if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
534
- el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
535
- } else {
536
- el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
537
- }
538
- }
539
- }
540
-
541
- rahe.sis.template = _.memoize( function ( id ) {
542
- var compiled,
543
- options = {
544
- evaluate: /<#([\s\S]+?)#>/g,
545
- interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
546
- escape: /\{\{([^\}]+?)\}\}(?!\})/g,
547
- variable: 'data'
548
- };
549
-
550
- return function ( data ) {
551
- compiled = compiled || _.template( jQuery( '#sis-' + id ).html(), null, options );
552
- return compiled( data );
553
- };
554
- });
555
-
556
- jQuery(function() {
557
- rahe.sis.regenerate.init();
558
- var bodyContent = jQuery( '#wpbody-content');
559
- // Regeneration listener
560
- jQuery( '#ajax_thumbnail_rebuild' ).click( function() { rahe.sis.regenerate.checkStartRegenerating(); } );
561
-
562
- // Add size button listener
563
- bodyContent.on( 'click', '#add_size',function( e ) { rahe.sis.sizes.add( e, this ); } )
564
-
565
- // Registering a new size listener
566
- .on( 'click', '.add_size_name', function( e ) { rahe.sis.sizes.register( e, this ); } )
567
-
568
- // Delete and Adding buttons
569
- .on( 'click', '.delete_size', function( e ) { rahe.sis.sizes.deleteSize( e, this ); } )
570
- .on( 'click', '.add_size', function( e ) { rahe.sis.sizes.ajaxRegister( e, this ); } )
571
-
572
- .on( 'click keyup change', '.h,.w,.c,.s,.n', function( e ) { rahe.sis.sizes.displayChange( this ); } )
573
-
574
- // Seup the getphp
575
- .on( 'click', '#get_php', function( e ){ rahe.sis.sizes.getPhp( e, this ) } );
576
- jQuery('#get_php').nextAll('code').hide();
577
-
578
- jQuery(".add_size").hide();
579
  });
1
+ // Functions for the regenerating of images
2
+ var rahe;
3
+ if( !rahe ) {
4
+ rahe = {};
5
+ } else if( typeof rahe !== "object" ) {
6
+ throw new Error( 'rahe already exists and not an object' );
7
+ }
8
+
9
+ if( !rahe.sis ) {
10
+ rahe.sis = {};
11
+ } else if( typeof rahe.sis !== "object" ) {
12
+ throw new Error( 'rahe.sis already exists and not an object' );
13
+ }
14
+
15
+ rahe.sis.regenerate = {
16
+ post_types : [],
17
+ thumbnails : [],
18
+ total : 0,
19
+ cur : 0,
20
+ timeScript: [],
21
+ dateScript: '',
22
+ percent : '' ,
23
+ percentText : null,
24
+ progress : null,
25
+ messageZone : null,
26
+ sisZone : null,
27
+ time : null,
28
+ timeZone : null,
29
+ buttonRegenerate : null,
30
+ errorZone : null,
31
+ errorMessages : null,
32
+ thumb : null,
33
+ thumbImg : null,
34
+ init : function() {
35
+ this.sisZone = jQuery('.sis');
36
+ this.percentText = jQuery('#sis_progress-percent');
37
+ this.progress = jQuery( '.progress' );
38
+ this.messageZone = this.sisZone.find(".regenerate_message");
39
+ this.time = this.sisZone.find(".time");
40
+ this.timeZone = this.time.find("p span.time_message");
41
+ this.buttonRegenerate = jQuery( "#ajax_thumbnail_rebuild" );
42
+ this.errorZone = jQuery( '#error_messages' );
43
+ this.errorMessages = this.errorZone.find( 'ul.messages' );
44
+ this.thumb = this.sisZone.find( '.thumb' );
45
+ this.thumbImg = this.sisZone.find( '.thumb-img' );
46
+ },
47
+ getThumbnails : function() {
48
+ var self = this,
49
+ inputs = jQuery( 'input.thumbnails:checked' );
50
+
51
+ // Get the checked thumbnails inputs
52
+ if (inputs.length != jQuery( 'input.thumbnails[type="checkbox"]' ).length) {
53
+ inputs.each( function( i ) {
54
+ self.thumbnails.push( this.value );
55
+ });
56
+ }
57
+ },
58
+ getPostTypes : function() {
59
+ var self = this,
60
+ inputs = jQuery( 'input.post_types:checked' );
61
+
62
+ // Get the checked post Types inputs
63
+ if ( inputs.length != jQuery( 'input.post_types[type="checkbox"]' ).length ) {
64
+ inputs.each( function() {
65
+ self.post_types.push( this.value );
66
+ } );
67
+ }
68
+ },
69
+ setMessage : function( msg ) {
70
+ // Display the message
71
+ this.messageZone.html( "<p>" + msg + "</p>" ).addClass( 'updated' ).addClass( 'fade' ).show();
72
+ },
73
+ setTimeMessage : function ( msg ) {
74
+ this.timeZone.html( msg );
75
+ },
76
+ checkStartRegenerating : function(){
77
+ if( jQuery( '.notSaved' ).size() > 0 ) {
78
+ var confirmation = confirm( sis.notSaved );
79
+
80
+ // Delete if ok else not delete
81
+ if( confirmation == true ) {
82
+ this.startRegenerating();
83
+ } else {
84
+ return false;
85
+ }
86
+ } else {
87
+ this.startRegenerating();
88
+ }
89
+ },
90
+ startRegenerating : function( ) {
91
+ var self = this,
92
+ wp_nonce = jQuery('input.getList').val();
93
+
94
+ // Get the humbnails and post types
95
+ self.getThumbnails();
96
+ self.getPostTypes();
97
+
98
+ this.dateScript = new Date();
99
+ // Start ajax
100
+ jQuery.ajax( {
101
+ url: sis.ajaxUrl,
102
+ type: "POST",
103
+ dataType: 'json',
104
+ data: {
105
+ action : 'sis_get_list',
106
+ post_types : self.post_types,
107
+ nonce : wp_nonce
108
+ },
109
+ beforeSend: function() {
110
+
111
+ // Disable the button
112
+ self.buttonRegenerate.attr( "disabled", true );
113
+ // Display the message
114
+ self.setMessage( sis.reading );
115
+
116
+ },
117
+ success: function( r ) {
118
+
119
+ if( typeof r !== 'object' ) {
120
+ self.reInit();
121
+ self.setMessage( sis.phpError );
122
+ return false;
123
+ }
124
+
125
+ self.time.show();
126
+
127
+ // Eval the response
128
+ self.total = r.total ;
129
+
130
+ // Set the current to 0
131
+ self.curr = 0;
132
+
133
+ // Display the progress Bar
134
+ self.progress.show().parent().show();
135
+
136
+ // Start Regenerating
137
+ self.regenItem();
138
+ }
139
+ });
140
+ },
141
+ regenItem : function( ) {
142
+ var self = this,
143
+ wp_nonce = jQuery('input.regen').val();
144
+
145
+ // If the list is empty display the message of emptyness and reinitialize the form
146
+ if ( this.total == 0 || _.isUndefined( this.total ) ) {
147
+ this.reInit();
148
+ this.setMessage( sis.noMedia );
149
+ return false;
150
+ }
151
+
152
+ // If we have finished the regeneration display message and init again
153
+ if ( this.curr >= this.total ) {
154
+ var now = new Date();
155
+ this.reInit();
156
+ this.setMessage( sis.done+this.curr+' '+sis.messageRegenerated+sis.startedAt+' '+this.dateScript.getHours()+":"+this.dateScript.getMinutes()+":"+this.dateScript.getSeconds()+sis.finishedAt+' '+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds() );
157
+ return;
158
+ }
159
+
160
+ // Set the message of current image regenerating
161
+ this.setMessage( sis.regenerating + ( this.curr + 1 ) + sis.of + this.total );
162
+ this.setMessage( sis.regenerating + ( this.curr + 1 ) + sis.of + this.total );
163
+
164
+ jQuery.ajax( {
165
+ url: sis.ajaxUrl,
166
+ type: "POST",
167
+ dataType: 'json',
168
+ data: {
169
+ action : 'sis_rebuild_images',
170
+ offset : this.curr,
171
+ thumbnails : this.thumbnails,
172
+ nonce : wp_nonce
173
+ },
174
+ beforeSend : function() {
175
+ // Calculate the percentage of regeneration
176
+ self.percent = ( self.curr / self.total ) * 100;
177
+
178
+ // Change the progression
179
+ self.progress.find( '.bar' ).width( self.percent+'%' )
180
+ .find('.percent').html( self.percent + '%' );
181
+
182
+ // Change the text of progression
183
+ self.percentText.removeClass( 'hidden' ).html( Math.round( self.percent ) + "%");
184
+ },
185
+ success: function( r ) {
186
+ // Check if error or a message in response
187
+ if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
188
+ var message ='';
189
+ if( typeof r !== 'object' ) {
190
+ message = sis.phpError;
191
+ } else {
192
+ message = r.error
193
+ }
194
+
195
+ self.errorZone.addClass( 'error message' );
196
+ self.errorMessages.prepend( '<li>'+message+'</li>' );
197
+ } else {
198
+
199
+ // Append a message if needed
200
+ if( r.message ) {
201
+ self.time.find( 'ul.messages' ).prepend( '<li>'+r.message+'</li>' );
202
+ }
203
+
204
+ // Display the image
205
+ self.thumb.show();
206
+
207
+ // Change his attribute
208
+ self.thumbImg.attr("src", r.src);
209
+
210
+ // Actual time
211
+ var dateEnd = new Date(),
212
+ curDate = new Date(),
213
+ num = 0,
214
+ sum = 0,
215
+ i = 0,
216
+ ave = 0,
217
+ time = '';
218
+
219
+ // Add the regenerating time to the array
220
+ self.timeScript.push( parseFloat( r.time.replace( ',', '.' ), 10 ) );
221
+
222
+ // Get the number of elements in array
223
+ num = self.timeScript.length;
224
+
225
+ // Make the sum of the times
226
+ for( i; i < num ; i++ ) {
227
+ sum += self.timeScript[i];
228
+ }
229
+
230
+ // Make the average value of the regenerating time
231
+ ave = sum/num,
232
+
233
+ // Round the value in miliseconds and add 25% or error
234
+ t = Math.round( ( ( ave * self.total ) * 1000 ) );
235
+
236
+ // Set the predicted time
237
+ dateEnd.setTime( self.dateScript.getTime() + t );
238
+
239
+ // Get the difference between the two dates
240
+ time = self.s2t( Math.abs( ( dateEnd.getTime() - curDate.getTime() ) ) / 1000 );
241
+
242
+ // Set the message in the notice box
243
+ self.setTimeMessage( dateEnd.getHours()+":"+dateEnd.getMinutes()+":"+dateEnd.getSeconds()+sis.or+time+sis.beforeEnd );
244
+ }
245
+
246
+ // Inscrease the counter and regene the next item
247
+ self.curr++;
248
+ self.regenItem();
249
+ }
250
+ });
251
+
252
+ },
253
+ s2t : function (secs) {
254
+ var secs = secs % 86400,
255
+ t = new Date(1970,0,1),
256
+ s = 0;
257
+
258
+ t.setSeconds(secs);
259
+ s = t.toTimeString().substr(0,8);
260
+ if( secs > 86399 ) {
261
+ s = Math.floor( ( t - Date.parse( "1/1/70" ) ) / 3600000 ) + s.substr( 2 );
262
+ }
263
+ return s;
264
+ },
265
+ reInit: function() {
266
+ // Re initilize the form
267
+ this.buttonRegenerate.removeAttr( "disabled" );
268
+ this.thumb.hide();
269
+ this.progress.hide();
270
+ this.percentText.addClass( 'hidden' );
271
+ }
272
+ };
273
+
274
+ rahe.sis.sizes = {
275
+ i: 0,
276
+ add: function(e,el) {
277
+ e.preventDefault();
278
+
279
+ // Create the template
280
+ var elTr = rahe.sis.template( 'new_size' );
281
+ elTr = elTr( {
282
+ size_id : this.i,
283
+ validate : sis.validate
284
+ } );
285
+
286
+ // Add the form for editing
287
+ jQuery(el).closest( 'tr' ).before( elTr );
288
+
289
+ // Inscrease the identifier
290
+ this.i++;
291
+ },
292
+ register: function( e, el ) {
293
+ // Stop propagation
294
+ e.preventDefault();
295
+
296
+ // Get name and id
297
+ var name = jQuery(el).closest('tr').children( 'th' ).find( 'input' ).val(),
298
+ id = jQuery(el).closest('tr').children('th').find( 'input' ).attr( 'id' ),
299
+
300
+ // Get the number of elements with this name
301
+ checkPresent = jQuery( el ).closest('tbody').find( 'input[value="'+name+'"]' ).length;
302
+
303
+ // Check if not basic size or already present, display message
304
+ if( name == 'thumbnail' || name == "medium" || name == "large" ) {
305
+ alert( sis.notOriginal );
306
+ return false;
307
+ } else if( checkPresent !=0 ) {
308
+ alert( sis.alreadyPresent );
309
+ return false;
310
+ }
311
+
312
+ var row = rahe.sis.template( 'new_size_row' );
313
+
314
+ row = row( {
315
+ size : sis.size,
316
+ size_name : name,
317
+ maximumWidth : sis.maximumWidth,
318
+ maximumHeight : sis.maximumHeight,
319
+ customName : sis.customName,
320
+ crop : sis.crop,
321
+ crop_positions :sis.crop_positions,
322
+ show : sis.show,
323
+ deleteImage : sis.deleteImage,
324
+ validateButton : sis.validateButton
325
+ } );
326
+
327
+ // Add the row to the current list
328
+ jQuery('#' + id).closest( 'tr' ).html( row );
329
+ },
330
+ deleteSize: function( e, el ) {
331
+ e.preventDefault();
332
+ // Check if user want to delete or not
333
+ var confirmation = confirm( sis.confirmDelete );
334
+
335
+ // Delete if ok else not delete
336
+ if( confirmation == true ) {
337
+ // Remove from the list and the array
338
+ jQuery( el ).closest( 'tr' ).remove();
339
+ this.ajaxUnregister( el );
340
+ }
341
+ },
342
+ getPhp : function( e, el ) {
343
+ e.preventDefault();
344
+ // Get parent element
345
+ var parent = jQuery( el ).closest( 'tr' );
346
+
347
+ jQuery.ajax( {
348
+ url: sis.ajaxUrl,
349
+ type: "POST",
350
+ data: { action : "sis_get_sizes" },
351
+ beforeSend: function() {
352
+ // Remove classes of status
353
+ parent.removeClass( 'addPending' );
354
+ parent.addClass( 'addPending' );
355
+ },
356
+ success: function( result ) {
357
+ // Add the classes for the status
358
+ jQuery( '#get_php' ).nextAll( 'code' ).html( '<br />' + result).show().css( { 'display' : 'block' } );
359
+ parent.removeClass( 'addPending' );
360
+ }
361
+ } );
362
+ },
363
+ ajaxRegister: function( e, el ) {
364
+ e.preventDefault();
365
+
366
+ // Get the vars
367
+ var self = this,
368
+ parentTable = jQuery( el ).closest( 'table' ),
369
+ timer,
370
+ wp_nonce = jQuery( '.addSize' ).val(),
371
+ parent = jQuery( el ).closest( 'tr' ),
372
+ n = parent.find( 'input[name="image_name"]' ).val(),
373
+ c = parent.find( 'select.crop' ).val(),
374
+ s = parent.find( 'input.show' ).val(),
375
+ cn = parent.find( 'input.n' ).val(),
376
+ h = 0,
377
+ w = 0;
378
+ s = ( s == false || s == undefined ) ? false : true ;
379
+ w = parseInt( parent.find( 'input.w' ).val() );
380
+ h = parseInt( parent.find( 'input.h' ).val() );
381
+
382
+ if( !parentTable.hasClass( 'ajaxing' ) ) {
383
+ jQuery.ajax({
384
+ url: sis.ajaxUrl,
385
+ type: "POST",
386
+ dataType :'json',
387
+ data: { action : "sis_add_size", width: w, height: h, crop: c, name: n, show: s, customName : cn , nonce : wp_nonce },
388
+ beforeSend: function() {
389
+ // Remove status and set pending
390
+ parent.removeClass();
391
+ parent.addClass( 'addPending' );
392
+ parentTable.addClass( 'ajaxing' );
393
+ },
394
+ success: function(result) {
395
+ // Set basic class and remove pending
396
+ var classTr = '';
397
+ parent.removeClass();
398
+ parentTable.removeClass( 'ajaxing' )
399
+
400
+ // Check the result for the different messages
401
+ if( result == 0 ) {
402
+ classTr = 'errorAdding';
403
+ } else if( result == 2 ) {
404
+ classTr = 'notChangedAdding';
405
+
406
+ // add/update to the array with the status class
407
+ self.addToArray( n, w, h, c, classTr );
408
+ } else {
409
+ classTr = 'successAdding';
410
+
411
+ // add/update to the array with the status class
412
+ self.addToArray( n, w, h, c, classTr );
413
+ }
414
+
415
+ // Add the new sizes values for checking of changed or not
416
+ parent.find( 'input.h' ).attr( { base_h : h } );
417
+ parent.find( 'input.w' ).attr( { base_w : w } );
418
+ parent.find( 'select.c' ).attr( { base_c : c } );
419
+ parent.find( 'input.s' ).attr( { base_s : s } );
420
+
421
+ // Add the generated class
422
+ parent.addClass( classTr );
423
+ parent.find( 'td' ).removeClass( "notSaved" );
424
+
425
+ // Change the button text
426
+ parent.find( '.add_size' ).removeClass('validate_size').hide().children('.ui-button-text' ).text( sis.update ) ;
427
+
428
+ clearTimeout( timer );
429
+ // Remove classes after 3 seconds
430
+ timer = setTimeout(function() {
431
+ parent.removeClass( 'errorAdding notChangedAdding successAdding' );
432
+ }, 2 * 1000 );
433
+ }
434
+ });
435
+ }
436
+ },
437
+ ajaxUnregister: function( el ) {
438
+ // Get name and self object
439
+ var self = this,
440
+ n = jQuery( el ).closest('tr').find( 'input[name="image_name"]' ).val(),
441
+ wp_nonce = jQuery( el ).closest('tr').find( 'input.deleteSize' ).val();
442
+
443
+ // Make the ajax call
444
+ jQuery.ajax({
445
+ url: sis.ajaxUrl,
446
+ type: "POST",
447
+ data: { action : "sis_remove_size", name: n, nonce : wp_nonce },
448
+ success: function(result) {
449
+ self.removeFromArray( el );
450
+ }
451
+ });
452
+ },
453
+ addToArray: function( n, w, h, c, s ) {
454
+ // Get the row for editing or updating
455
+ var testRow = jQuery( '#sis-'+n ),
456
+ newRow = '',
457
+ timer;
458
+
459
+ // Get the right newRow, updating or adding ?
460
+ if( testRow.length != 0 ) {
461
+ newRow = testRow.closest( 'tr' );
462
+ } else {
463
+ newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone().attr( 'id', 'sis-'+n );
464
+ }
465
+
466
+ c = !_.isUndefined( sis.crop_positions[c] ) ? sis.crop_positions[c] : sis.fl ;
467
+
468
+ // Set the datas with the given datas
469
+ newRow.find( 'th > label' ).attr( 'for', n )
470
+ .end()
471
+ .find( 'input.thumbnails' ).val( n ).attr( 'id', n )
472
+ .end()
473
+ .find( 'th:nth-child(2) > label' ).text( n )
474
+ .end()
475
+ .find( 'th:nth-child(3) > label' ).text( w+'px' )
476
+ .end()
477
+ .find( 'th:nth-child(4) > label' ).text( h+'px' )
478
+ .end()
479
+ .find( 'th:nth-child(5) > label' ).text( c );
480
+
481
+ // If new then add the row
482
+ if( testRow.length == 0 ) {
483
+ newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
484
+ }
485
+
486
+ // Remove the previous status classes and add the status class
487
+ newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
488
+
489
+ clearTimeout( timer );
490
+ // Remove the statuses classes
491
+ timer = setTimeout(function() {
492
+ newRow.removeClass( 'errorAdding notChangedAdding successAdding' );
493
+ }, 3 * 1000 );
494
+ },
495
+ removeFromArray: function( el ) {
496
+ // get the name
497
+ var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
498
+
499
+ // Remove the given name from the array
500
+ jQuery( '#sis-'+n ).remove();
501
+ },
502
+ displayChange : function( el ) {
503
+ var el = jQuery( el ),
504
+ parent = el.closest( 'tr' );
505
+
506
+ // Check not new size
507
+ if( parent.hasClass( 'new_size' ) ) {
508
+ return false;
509
+ }
510
+
511
+ var h_el = parent.find( 'input.h' ),
512
+ w_el = parent.find( 'input.w' ),
513
+ c_el = parent.find( 'select.c' ),
514
+ s_el = parent.find( 'input.s' ),
515
+ n_el = parent.find( 'input.n' ),
516
+
517
+ h = h_el.val(),
518
+ w = w_el.val(),
519
+ c = c_el.val(),
520
+ s = s_el.val(),
521
+ n = n_el.val(),
522
+
523
+ base_h = h_el.attr( 'base_h' ),
524
+ base_w = w_el.attr( 'base_w' ),
525
+ base_c = c_el.attr( 'base_c' ),
526
+ base_s = s_el.attr( 'base_s' ),
527
+ base_n = n_el.attr( 'base_n' );
528
+
529
+
530
+ base_c = base_c == '0' ? false : true;
531
+ base_s = base_s == '0' ? false : true;
532
+
533
+ if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
534
+ el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
535
+ } else {
536
+ el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
537
+ }
538
+ }
539
+ }
540
+
541
+ rahe.sis.template = _.memoize( function ( id ) {
542
+ var compiled,
543
+ options = {
544
+ evaluate: /<#([\s\S]+?)#>/g,
545
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
546
+ escape: /\{\{([^\}]+?)\}\}(?!\})/g,
547
+ variable: 'data'
548
+ };
549
+
550
+ return function ( data ) {
551
+ compiled = compiled || _.template( jQuery( '#sis-' + id ).html(), null, options );
552
+ return compiled( data );
553
+ };
554
+ });
555
+
556
+ jQuery(function() {
557
+ rahe.sis.regenerate.init();
558
+ var bodyContent = jQuery( '#wpbody-content');
559
+ // Regeneration listener
560
+ jQuery( '#ajax_thumbnail_rebuild' ).click( function() { rahe.sis.regenerate.checkStartRegenerating(); } );
561
+
562
+ // Add size button listener
563
+ bodyContent.on( 'click', '#add_size',function( e ) { rahe.sis.sizes.add( e, this ); } )
564
+
565
+ // Registering a new size listener
566
+ .on( 'click', '.add_size_name', function( e ) { rahe.sis.sizes.register( e, this ); } )
567
+
568
+ // Delete and Adding buttons
569
+ .on( 'click', '.delete_size', function( e ) { rahe.sis.sizes.deleteSize( e, this ); } )
570
+ .on( 'click', '.add_size', function( e ) { rahe.sis.sizes.ajaxRegister( e, this ); } )
571
+
572
+ .on( 'click keyup change', '.h,.w,.c,.s,.n', function( e ) { rahe.sis.sizes.displayChange( this ); } )
573
+
574
+ // Seup the getphp
575
+ .on( 'click', '#get_php', function( e ){ rahe.sis.sizes.getPhp( e, this ) } );
576
+ jQuery('#get_php').nextAll('code').hide();
577
+
578
+ jQuery(".add_size").hide();
579
  });
classes/admin/main.php CHANGED
@@ -1,331 +1,331 @@
1
- <?php
2
-
3
- Class SIS_Admin_Main {
4
-
5
- public function __construct() {
6
- add_action( 'admin_init', array( __CLASS__, 'register_assets' ) );
7
- }
8
-
9
- /**
10
- *
11
- */
12
- public static function register_assets() {
13
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';
14
- // Add javascript
15
- wp_register_script( 'underscore', '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js', array(), '1.6.0' );
16
- wp_register_script( 'sis_js', SIS_URL . '/assets/js/sis' . $suffix . '.js', array(
17
- 'jquery',
18
- 'jquery-ui-button',
19
- 'jquery-ui-progressbar',
20
- 'underscore'
21
- ), SIS_VERSION );
22
-
23
- // Differencitate the scripts
24
- wp_register_script( 'sis_js_attachments', SIS_URL . '/assets/js/sis-attachments' . $suffix . '.js', array( 'jquery' ), SIS_VERSION );
25
-
26
- // Add javascript translation
27
- wp_localize_script( 'sis_js', 'sis', self::localize_vars() );
28
- wp_localize_script( 'sis_js_attachments', 'sis', self::localize_vars() );
29
-
30
- // Add CSS
31
- wp_enqueue_style( 'sis_css', SIS_URL . '/assets/css/sis-style' . $suffix . '.css', array(), SIS_VERSION );
32
- }
33
-
34
-
35
- /**
36
- * Localize the var for javascript
37
- *
38
- * @access public
39
- * @return array
40
- * @author Nicolas Juen
41
- */
42
- public static function localize_vars() {
43
- return array(
44
- 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
45
- 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
46
- 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
47
- 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
48
- 'crop' => __( 'Crop', 'simple-image-sizes' ),
49
- 'tr' => __( 'yes', 'simple-image-sizes' ),
50
- 'fl' => __( 'no', 'simple-image-sizes' ),
51
- 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
52
- 'of' => __( ' of ', 'simple-image-sizes' ),
53
- 'or' => __( ' or ', 'simple-image-sizes' ),
54
- 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
55
- 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
56
- 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
57
- 'regenerating' => __( 'Regenerating ', 'simple-image-sizes' ),
58
- 'regenerate' => __( 'Regenerate ', 'simple-image-sizes' ),
59
- 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
60
- 'done' => __( 'Done.', 'simple-image-sizes' ),
61
- 'size' => __( 'Size', 'simple-image-sizes' ),
62
- 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
63
- 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
64
- 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
65
- 'update' => __( 'Update', 'simple-image-sizes' ),
66
- 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
67
- 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
68
- 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
69
- 'startedAt' => __( ' started at', 'simple-image-sizes' ),
70
- 'customName' => __( 'Public name', 'simple-image-sizes' ),
71
- 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
72
- 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
73
- 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
74
- 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
75
- 'crop_positions' => self::get_available_crop(),
76
- 'regen_one' => wp_create_nonce( 'regen' )
77
- );
78
- }
79
-
80
- /**
81
- * Rebuild the given attribute with the given thumbnails
82
- *
83
- * @param $att_id
84
- * @param $thumbnails
85
- *
86
- * @return array
87
- * @author Nicolas Juen
88
- */
89
- public static function thumbnail_rebuild( $att_id, $thumbnails = null ) {
90
- // Time a the begining
91
- timer_start();
92
-
93
- // Check Id
94
- if ( (int) $att_id <= 0 ) {
95
- return array(
96
- 'time' => timer_stop( false, 4 ),
97
- 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' )
98
- );
99
- }
100
-
101
- // Get the path
102
- $fullsizepath = get_attached_file( $att_id );
103
-
104
- // Regen the attachment
105
- if ( false !== $fullsizepath && file_exists( $fullsizepath ) ) {
106
- if ( false == wp_update_attachment_metadata( $att_id, self::wp_generate_attachment_metadata_custom( $att_id, $fullsizepath, $thumbnails ) ) ) {
107
- return array(
108
- 'src' => wp_get_attachment_thumb_url( $att_id ),
109
- 'time' => timer_stop( false, 4 ),
110
- 'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes' ), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
111
- );
112
- }
113
- } else {
114
- return array(
115
- 'src' => wp_get_attachment_thumb_url( $att_id ),
116
- 'time' => timer_stop( false, 4 ),
117
- 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes' ), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
118
- );
119
-
120
- }
121
-
122
- // Display the attachment url for feedback
123
- return array(
124
- 'time' => timer_stop( false, 4 ),
125
- 'src' => wp_get_attachment_thumb_url( $att_id ),
126
- 'title' => get_the_title( $att_id )
127
- );
128
- }
129
-
130
- /**
131
- * Include the javascript template
132
- *
133
- * @param void
134
- *
135
- * @return bool
136
- */
137
- public static function add_template() {
138
- global $pagenow;
139
- if ( 'options-media.php' !== $pagenow ) {
140
- return false;
141
- }
142
-
143
- if ( is_file( SIS_DIR . '/templates/admin-js.html' ) ) {
144
- include( SIS_DIR . '/templates/admin-js.html' );
145
- }
146
-
147
- return true;
148
- }
149
-
150
- /**
151
- * Get all the available cropping
152
- *
153
- * @return array
154
- *
155
- * @param void
156
- *
157
- * @author Nicolas Juen
158
- */
159
- public static function get_available_crop() {
160
- global $wp_version;
161
-
162
- // Return the only possible
163
- if ( version_compare( $wp_version, '3.9', '<' ) ) {
164
- return array();
165
- }
166
-
167
- $x = array(
168
- 'left' => __( 'Left', 'simple-image-sizes' ),
169
- 'center' => __( 'Center', 'simple-image-sizes' ),
170
- 'right' => __( 'Right', 'simple-image-sizes' ),
171
- );
172
-
173
- $y = array(
174
- 'top' => __( 'top', 'simple-image-sizes' ),
175
- 'center' => __( 'center', 'simple-image-sizes' ),
176
- 'bottom' => __( 'bottom', 'simple-image-sizes' ),
177
- );
178
-
179
- $crops = array();
180
- foreach ( $x as $x_pos => $x_pos_label ) {
181
- foreach ( $y as $y_pos => $y_pos_label ) {
182
- $crops[ $x_pos . '_' . $y_pos ] = $x_pos_label . ' ' . $y_pos_label;
183
- }
184
- }
185
-
186
- return $crops;
187
- }
188
-
189
- /**
190
- * Check if the crop is available
191
- *
192
- * @param string $crop_position
193
- *
194
- * @return bool
195
- * @author Nicolas Juen
196
- */
197
- public static function is_crop_position( $crop_position ) {
198
- $crops = self::get_available_crop();
199
-
200
- return isset( $crops[ $crop_position ] );
201
- }
202
-
203
- /**
204
- * Return the crop position label from the slug
205
- *
206
- *
207
- * @param string $crop_position
208
- *
209
- * @return string
210
- * @author Nicolas Juen
211
- */
212
- public static function get_crop_position_label( $crop_position ) {
213
- if ( ! self::is_crop_position( $crop_position ) ) {
214
- return '';
215
- }
216
- $crops = self::get_available_crop();
217
-
218
- return $crops[ $crop_position ];
219
- }
220
-
221
-
222
- /**
223
- * Display a json encoded element with right headers
224
- *
225
- * @param $data (optional) : the element to display ( if needed )
226
- *
227
- * @return void
228
- * @author Nicolas Juen
229
- */
230
- public static function displayJson( $data = array() ) {
231
- if ( function_exists( 'wp_send_json' ) ) {
232
- wp_send_json( $data );
233
- }
234
-
235
- header( 'Cache-Control: no-cache, must-revalidate' );
236
- header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
237
- header( 'Content-type: application/json' );
238
- echo json_encode( $data );
239
- die();
240
- }
241
-
242
- /**
243
- * Generate post thumbnail attachment meta data.
244
- *
245
- * @since 2.1.0
246
- *
247
- * @param int $attachment_id Attachment Id to process.
248
- * @param string $file Filepath of the Attached image.
249
- *
250
- * @return mixed Metadata for attachment.
251
- */
252
- public static function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = null ) {
253
- $attachment = get_post( $attachment_id );
254
-
255
- $meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
256
-
257
- $metadata = array();
258
- if ( preg_match( '!^image/!', get_post_mime_type( $attachment ) ) && file_is_displayable_image( $file ) ) {
259
- $imagesize = getimagesize( $file );
260
- $metadata['width'] = $imagesize[0];
261
- $metadata['height'] = $imagesize[1];
262
- list( $uwidth, $uheight ) = wp_constrain_dimensions( $metadata['width'], $metadata['height'], 128, 96 );
263
- $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
264
-
265
- // Make the file path relative to the upload dir
266
- $metadata['file'] = _wp_relative_upload_path( $file );
267
-
268
- // make thumbnails and other intermediate sizes
269
- global $_wp_additional_image_sizes;
270
-
271
- foreach ( get_intermediate_image_sizes() as $s ) {
272
- $sizes[ $s ] = array( 'width' => '', 'height' => '', 'crop' => false );
273
- if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
274
- $sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
275
- } // For theme-added sizes
276
- else {
277
- $sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
278
- } // For default sizes set in options
279
- if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
280
- $sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
281
- } // For theme-added sizes
282
- else {
283
- $sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
284
- } // For default sizes set in options
285
- if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
286
- $sizes[ $s ]['crop'] = intval( $_wp_additional_image_sizes[ $s ]['crop'] );
287
- } // For theme-added sizes
288
- else {
289
- $sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
290
- } // For default sizes set in options
291
- }
292
-
293
- $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
294
-
295
- // Only if not all sizes
296
- if ( isset( $thumbnails ) && is_array( $thumbnails ) && isset( $meta_datas['sizes'] ) && ! empty( $meta_datas['sizes'] ) ) {
297
- // Fill the array with the other sizes not have to be done
298
- foreach ( $meta_datas['sizes'] as $name => $fsize ) {
299
- $metadata['sizes'][ $name ] = $fsize;
300
- }
301
- }
302
-
303
- foreach ( $sizes as $size => $size_data ) {
304
- if ( isset( $thumbnails ) ) {
305
- if ( ! in_array( $size, $thumbnails ) ) {
306
- continue;
307
- }
308
- }
309
-
310
- $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
311
-
312
- if ( isset( $meta_datas['size'][ $size ] ) ) {
313
- // Remove the size from the orignal sizes for after work
314
- unset( $meta_datas['size'][ $size ] );
315
- }
316
-
317
- if ( $resized ) {
318
- $metadata['sizes'][ $size ] = $resized;
319
- }
320
- }
321
-
322
- // fetch additional metadata from exif/iptc
323
- $image_meta = wp_read_image_metadata( $file );
324
- if ( $image_meta ) {
325
- $metadata['image_meta'] = $image_meta;
326
- }
327
- }
328
-
329
- return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
330
- }
331
  }
1
+ <?php
2
+
3
+ Class SIS_Admin_Main {
4
+
5
+ public function __construct() {
6
+ add_action( 'admin_init', array( __CLASS__, 'register_assets' ) );
7
+ }
8
+
9
+ /**
10
+ *
11
+ */
12
+ public static function register_assets() {
13
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';
14
+ // Add javascript
15
+ wp_register_script( 'underscore', 'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.0/underscore-min.js', array(), '1.8.0' );
16
+ wp_register_script( 'sis_js', SIS_URL . 'assets/js/sis' . $suffix . '.js', array(
17
+ 'jquery',
18
+ 'jquery-ui-button',
19
+ 'jquery-ui-progressbar',
20
+ 'underscore'
21
+ ), SIS_VERSION );
22
+
23
+ // Differencitate the scripts
24
+ wp_register_script( 'sis_js_attachments', SIS_URL . 'assets/js/sis-attachments' . $suffix . '.js', array( 'jquery' ), SIS_VERSION );
25
+
26
+ // Add javascript translation
27
+ wp_localize_script( 'sis_js', 'sis', self::localize_vars() );
28
+ wp_localize_script( 'sis_js_attachments', 'sis', self::localize_vars() );
29
+
30
+ // Add CSS
31
+ wp_enqueue_style( 'sis_css', SIS_URL . 'assets/css/sis-style' . $suffix . '.css', array(), SIS_VERSION );
32
+ }
33
+
34
+
35
+ /**
36
+ * Localize the var for javascript
37
+ *
38
+ * @access public
39
+ * @return array
40
+ * @author Nicolas Juen
41
+ */
42
+ public static function localize_vars() {
43
+ return array(
44
+ 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
45
+ 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
46
+ 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
47
+ 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
48
+ 'crop' => __( 'Crop', 'simple-image-sizes' ),
49
+ 'tr' => __( 'yes', 'simple-image-sizes' ),
50
+ 'fl' => __( 'no', 'simple-image-sizes' ),
51
+ 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
52
+ 'of' => __( ' of ', 'simple-image-sizes' ),
53
+ 'or' => __( ' or ', 'simple-image-sizes' ),
54
+ 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
55
+ 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
56
+ 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
57
+ 'regenerating' => __( 'Regenerating ', 'simple-image-sizes' ),
58
+ 'regenerate' => __( 'Regenerate ', 'simple-image-sizes' ),
59
+ 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
60
+ 'done' => __( 'Done.', 'simple-image-sizes' ),
61
+ 'size' => __( 'Size', 'simple-image-sizes' ),
62
+ 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
63
+ 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
64
+ 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
65
+ 'update' => __( 'Update', 'simple-image-sizes' ),
66
+ 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
67
+ 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
68
+ 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
69
+ 'startedAt' => __( ' started at', 'simple-image-sizes' ),
70
+ 'customName' => __( 'Public name', 'simple-image-sizes' ),
71
+ 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
72
+ 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
73
+ 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
74
+ 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
75
+ 'crop_positions' => self::get_available_crop(),
76
+ 'regen_one' => wp_create_nonce( 'regen' )
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Rebuild the given attribute with the given thumbnails
82
+ *
83
+ * @param $att_id
84
+ * @param $thumbnails
85
+ *
86
+ * @return array
87
+ * @author Nicolas Juen
88
+ */
89
+ public static function thumbnail_rebuild( $att_id, $thumbnails = null ) {
90
+ // Time a the begining
91
+ timer_start();
92
+
93
+ // Check Id
94
+ if ( (int) $att_id <= 0 ) {
95
+ return array(
96
+ 'time' => timer_stop( false, 4 ),
97
+ 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' )
98
+ );
99
+ }
100
+
101
+ // Get the path
102
+ $fullsizepath = get_attached_file( $att_id );
103
+
104
+ // Regen the attachment
105
+ if ( false !== $fullsizepath && file_exists( $fullsizepath ) ) {
106
+ if ( false == wp_update_attachment_metadata( $att_id, self::wp_generate_attachment_metadata_custom( $att_id, $fullsizepath, $thumbnails ) ) ) {
107
+ return array(
108
+ 'src' => wp_get_attachment_thumb_url( $att_id ),
109
+ 'time' => timer_stop( false, 4 ),
110
+ 'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes' ), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
111
+ );
112
+ }
113
+ } else {
114
+ return array(
115
+ 'src' => wp_get_attachment_thumb_url( $att_id ),
116
+ 'time' => timer_stop( false, 4 ),
117
+ 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes' ), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
118
+ );
119
+
120
+ }
121
+
122
+ // Display the attachment url for feedback
123
+ return array(
124
+ 'time' => timer_stop( false, 4 ),
125
+ 'src' => wp_get_attachment_thumb_url( $att_id ),
126
+ 'title' => get_the_title( $att_id )
127
+ );
128
+ }
129
+
130
+ /**
131
+ * Include the javascript template
132
+ *
133
+ * @param void
134
+ *
135
+ * @return bool
136
+ */
137
+ public static function add_template() {
138
+ global $pagenow;
139
+ if ( 'options-media.php' !== $pagenow ) {
140
+ return false;
141
+ }
142
+
143
+ if ( is_file( SIS_DIR . '/templates/admin-js.html' ) ) {
144
+ include( SIS_DIR . '/templates/admin-js.html' );
145
+ }
146
+
147
+ return true;
148
+ }
149
+
150
+ /**
151
+ * Get all the available cropping
152
+ *
153
+ * @return array
154
+ *
155
+ * @param void
156
+ *
157
+ * @author Nicolas Juen
158
+ */
159
+ public static function get_available_crop() {
160
+ global $wp_version;
161
+
162
+ // Return the only possible
163
+ if ( version_compare( $wp_version, '3.9', '<' ) ) {
164
+ return array();
165
+ }
166
+
167
+ $x = array(
168
+ 'left' => __( 'Left', 'simple-image-sizes' ),
169
+ 'center' => __( 'Center', 'simple-image-sizes' ),
170
+ 'right' => __( 'Right', 'simple-image-sizes' ),
171
+ );
172
+
173
+ $y = array(
174
+ 'top' => __( 'top', 'simple-image-sizes' ),
175
+ 'center' => __( 'center', 'simple-image-sizes' ),
176
+ 'bottom' => __( 'bottom', 'simple-image-sizes' ),
177
+ );
178
+
179
+ $crops = array();
180
+ foreach ( $x as $x_pos => $x_pos_label ) {
181
+ foreach ( $y as $y_pos => $y_pos_label ) {
182
+ $crops[ $x_pos . '_' . $y_pos ] = $x_pos_label . ' ' . $y_pos_label;
183
+ }
184
+ }
185
+
186
+ return $crops;
187
+ }
188
+
189
+ /**
190
+ * Check if the crop is available
191
+ *
192
+ * @param string $crop_position
193
+ *
194
+ * @return bool
195
+ * @author Nicolas Juen
196
+ */
197
+ public static function is_crop_position( $crop_position ) {
198
+ $crops = self::get_available_crop();
199
+
200
+ return isset( $crops[ $crop_position ] );
201
+ }
202
+
203
+ /**
204
+ * Return the crop position label from the slug
205
+ *
206
+ *
207
+ * @param string $crop_position
208
+ *
209
+ * @return string
210
+ * @author Nicolas Juen
211
+ */
212
+ public static function get_crop_position_label( $crop_position ) {
213
+ if ( ! self::is_crop_position( $crop_position ) ) {
214
+ return '';
215
+ }
216
+ $crops = self::get_available_crop();
217
+
218
+ return $crops[ $crop_position ];
219
+ }
220
+
221
+
222
+ /**
223
+ * Display a json encoded element with right headers
224
+ *
225
+ * @param $data (optional) : the element to display ( if needed )
226
+ *
227
+ * @return void
228
+ * @author Nicolas Juen
229
+ */
230
+ public static function displayJson( $data = array() ) {
231
+ if ( function_exists( 'wp_send_json' ) ) {
232
+ wp_send_json( $data );
233
+ }
234
+
235
+ header( 'Cache-Control: no-cache, must-revalidate' );
236
+ header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
237
+ header( 'Content-type: application/json' );
238
+ echo json_encode( $data );
239
+ die();
240
+ }
241
+
242
+ /**
243
+ * Generate post thumbnail attachment meta data.
244
+ *
245
+ * @since 2.1.0
246
+ *
247
+ * @param int $attachment_id Attachment Id to process.
248
+ * @param string $file Filepath of the Attached image.
249
+ *
250
+ * @return mixed Metadata for attachment.
251
+ */
252
+ public static function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = null ) {
253
+ $attachment = get_post( $attachment_id );
254
+
255
+ $meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
256
+
257
+ $metadata = array();
258
+ if ( preg_match( '!^image/!', get_post_mime_type( $attachment ) ) && file_is_displayable_image( $file ) ) {
259
+ $imagesize = getimagesize( $file );
260
+ $metadata['width'] = $imagesize[0];
261
+ $metadata['height'] = $imagesize[1];
262
+ list( $uwidth, $uheight ) = wp_constrain_dimensions( $metadata['width'], $metadata['height'], 128, 96 );
263
+ $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
264
+
265
+ // Make the file path relative to the upload dir
266
+ $metadata['file'] = _wp_relative_upload_path( $file );
267
+
268
+ // make thumbnails and other intermediate sizes
269
+ global $_wp_additional_image_sizes;
270
+
271
+ foreach ( get_intermediate_image_sizes() as $s ) {
272
+ $sizes[ $s ] = array( 'width' => '', 'height' => '', 'crop' => false );
273
+ if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
274
+ $sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
275
+ } // For theme-added sizes
276
+ else {
277
+ $sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
278
+ } // For default sizes set in options
279
+ if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
280
+ $sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
281
+ } // For theme-added sizes
282
+ else {
283
+ $sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
284
+ } // For default sizes set in options
285
+ if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
286
+ $sizes[ $s ]['crop'] = intval( $_wp_additional_image_sizes[ $s ]['crop'] );
287
+ } // For theme-added sizes
288
+ else {
289
+ $sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
290
+ } // For default sizes set in options
291
+ }
292
+
293
+ $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
294
+
295
+ // Only if not all sizes
296
+ if ( isset( $thumbnails ) && is_array( $thumbnails ) && isset( $meta_datas['sizes'] ) && ! empty( $meta_datas['sizes'] ) ) {
297
+ // Fill the array with the other sizes not have to be done
298
+ foreach ( $meta_datas['sizes'] as $name => $fsize ) {
299
+ $metadata['sizes'][ $name ] = $fsize;
300
+ }
301
+ }
302
+
303
+ foreach ( $sizes as $size => $size_data ) {
304
+ if ( isset( $thumbnails ) ) {
305
+ if ( ! in_array( $size, $thumbnails ) ) {
306
+ continue;
307
+ }
308
+ }
309
+
310
+ $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
311
+
312
+ if ( isset( $meta_datas['size'][ $size ] ) ) {
313
+ // Remove the size from the orignal sizes for after work
314
+ unset( $meta_datas['size'][ $size ] );
315
+ }
316
+
317
+ if ( $resized ) {
318
+ $metadata['sizes'][ $size ] = $resized;
319
+ }
320
+ }
321
+
322
+ // fetch additional metadata from exif/iptc
323
+ $image_meta = wp_read_image_metadata( $file );
324
+ if ( $image_meta ) {
325
+ $metadata['image_meta'] = $image_meta;
326
+ }
327
+ }
328
+
329
+ return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
330
+ }
331
  }
classes/admin/media.php CHANGED
@@ -1,525 +1,529 @@
1
- <?php
2
-
3
- Class SIS_Admin_Media {
4
-
5
- // Original sizes
6
- public static $original = array( 'thumbnail', 'medium', 'large' );
7
-
8
- public function __construct() {
9
- // Init
10
-
11
- add_action( 'admin_menu', array( __CLASS__, 'init' ) );
12
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
13
-
14
- // Add ajax action
15
- // Option page
16
- add_action( 'wp_ajax_' . 'sis_get_list', array( __CLASS__, 'a_get_list' ) );
17
- add_action( 'wp_ajax_' . 'sis_rebuild_images', array( __CLASS__, 'a_thumbnails_rebuild' ) );
18
- add_action( 'wp_ajax_' . 'sis_get_sizes', array( __CLASS__, 'a_get_sizes' ) );
19
- add_action( 'wp_ajax_' . 'sis_add_size', array( __CLASS__, 'a_add_size' ) );
20
- add_action( 'wp_ajax_' . 'sis_remove_size', array( __CLASS__, 'a_remove_size' ) );
21
-
22
- // Add link in plugins list
23
- add_filter( 'plugin_action_links', array( __CLASS__, 'add_settings_link' ), 10, 2 );
24
- }
25
-
26
- /**
27
- * Register javascripts and css.
28
- *
29
- * @access public
30
- * @return void
31
- * @author Nicolas Juen
32
- */
33
- public static function enqueue_assets( $hook_suffix = '' ) {
34
- if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
35
- return false;
36
- }
37
-
38
- if ( 'options-media.php' == $hook_suffix ) {
39
- // Add javascript
40
- wp_enqueue_script( 'sis_js' );
41
-
42
- // Add CSS
43
- wp_enqueue_style( 'sis_css' );
44
-
45
- // Add underscore template
46
- add_action( 'admin_footer', array( 'SIS_Admin_Main', 'add_template' ) );
47
- }
48
- }
49
-
50
-
51
- /**
52
- * Add a link to the setting option page
53
- *
54
- * @access public
55
- *
56
- * @param array $links
57
- * @param string $file
58
- *
59
- * @return void
60
- * @author Nicolas Juen
61
- */
62
- public static function add_settings_link( $links, $file ) {
63
-
64
- if ( 'simple-image-sizes/simple_image_sizes.php' !== $file ) {
65
- return $links;
66
- }
67
-
68
- $settings_link = '<a href="' . admin_url( 'options-media.php' ) . '"> ' . __( 'Settings', 'simple-image-sizes' ) . ' </a>';
69
- array_unshift( $links, $settings_link );
70
-
71
- return $links;
72
- }
73
-
74
- /**
75
- * Init for the option page
76
- *
77
- * @access public
78
- * @return void
79
- * @author Nicolas Juen
80
- */
81
- public static function init() {
82
- // Check if admin
83
- if ( ! is_admin() ) {
84
- return false;
85
- }
86
-
87
- // Get the image sizes
88
- global $_wp_additional_image_sizes;
89
- $options = get_option( SIS_OPTION );
90
-
91
- // Get the sizes and add the settings
92
- foreach ( get_intermediate_image_sizes() as $s ) {
93
- // Don't make the original sizes or numeric sizes that appear
94
- if ( in_array( $s, self::$original ) || is_integer( $s ) ) {
95
- continue;
96
- }
97
-
98
- // Set width
99
- $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
100
-
101
- // Set height
102
- $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
103
-
104
- //Set crop
105
- $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? intval( $_wp_additional_image_sizes[ $s ]['crop'] ) : get_option( "{$s}_crop" );
106
-
107
- // Add the setting field for this size
108
- add_settings_field( 'image_size_' . $s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array(
109
- __CLASS__,
110
- 'image_sizes'
111
- ), 'media', 'default', array( 'name' => $s, 'width' => $width, 'height' => $height, 'c' => $crop ) );
112
- }
113
-
114
- // Register the setting for media option page
115
- register_setting( 'media', SIS_OPTION );
116
-
117
- // Add the button
118
- add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array(
119
- __CLASS__,
120
- 'addSizeButton'
121
- ), 'media' );
122
-
123
- // Add php button
124
- add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array(
125
- __CLASS__,
126
- 'getPhpButton'
127
- ), 'media' );
128
-
129
- // Add section for the thumbnail regeneration
130
- add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array(
131
- __CLASS__,
132
- 'thumbnailRegenerate'
133
- ), 'media' );
134
- }
135
-
136
- /**
137
- * Display the row of the image size
138
- *
139
- * @access public
140
- *
141
- * @param mixed $args
142
- *
143
- * @return void
144
- * @author Nicolas Juen
145
- */
146
- public static function image_sizes( $args ) {
147
-
148
- if ( is_integer( $args['name'] ) ) {
149
- return;
150
- }
151
-
152
- // Get the options
153
- $sizes = (array) get_option( SIS_OPTION, array() );
154
-
155
- // Get the vars
156
- $height = isset( $sizes[ $args['name'] ]['h'] ) ? $sizes[ $args['name'] ]['h'] : $args['height'];
157
- $width = isset( $sizes[ $args['name'] ]['w'] ) ? $sizes[ $args['name'] ]['w'] : $args['width'];
158
- $crop = isset( $sizes[ $args['name'] ]['c'] ) && ! empty( $sizes[ $args['name'] ]['c'] ) ? $sizes[ $args['name'] ]['c'] : $args['c'];
159
- $show = isset( $sizes[ $args['name'] ]['s'] ) && ! empty( $sizes[ $args['name'] ]['s'] ) ? '1' : '0';
160
- $custom = isset( $sizes[ $args['name'] ]['custom'] ) && ! empty( $sizes[ $args['name'] ]['custom'] ) ? '1' : '0';
161
- $name = isset( $sizes[ $args['name'] ]['n'] ) && ! empty( $sizes[ $args['name'] ]['n'] ) ? esc_html( $sizes[ $args['name'] ]['n'] ) : esc_html( $args['name'] );
162
- ?>
163
- <input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name"/>
164
- <?php if ( $custom ): ?>
165
- <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" type="hidden"
166
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" value="1"/>
167
- <?php else: ?>
168
- <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" type="hidden"
169
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" value="1"/>
170
- <?php endif; ?>
171
- <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>">
172
- <?php _e( 'Maximum width', 'simple-image-sizes' ); ?>
173
- <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>" class='w small-text'
174
- type="number" step='1' min='0'
175
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>"
176
- base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>"/>
177
- </label>
178
- <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>">
179
- <?php _e( 'Maximum height', 'simple-image-sizes' ); ?>
180
- <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>" class='h small-text'
181
- type="number" step='1' min='0'
182
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>"
183
- base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>"/>
184
- </label>
185
- <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>">
186
- <?php _e( 'Public name', 'simple-image-sizes' ); ?>
187
- <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>" class='n'
188
- type="text" id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>"
189
- base_n='<?php echo $name; ?>' value="<?php echo $name ?>"/>
190
- </label>
191
- <span class="size_options">
192
- <label class="c"
193
- for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes' ); ?></label>
194
- <select id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>" class="c crop"
195
- base_c='<?php echo esc_attr( $crop ); ?>'
196
- name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>">
197
- <option
198
- value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
199
- <option
200
- value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
201
- <?php foreach ( SIS_Admin_Main::get_available_crop() as $crop_position => $label ): ?>
202
- <option <?php selected( $crop_position, $crop ); ?>
203
- value="<?php echo esc_attr( $crop_position ) ?>"><?php echo esc_html( $label ); ?></option>
204
- <?php endforeach; ?>
205
- </select>
206
-
207
- <input type='checkbox'
208
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" <?php checked( $show, 1 ) ?>
209
- class="s show" base_s='<?php echo esc_attr( $show ); ?>'
210
- name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" value="1"/>
211
- <label class="s"
212
- for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>"><?php _e( 'Show in post insertion ?', 'simple-image-sizes' ); ?></label>
213
- </span>
214
- <span class="delete_size button-secondary"><?php _e( 'Delete', 'simple-image-sizes' ); ?></span>
215
- <span class="add_size validate_size button-primary"><?php _e( 'Update', 'simple-image-sizes' ); ?></span>
216
-
217
- <input type="hidden" class="deleteSize button-primary"
218
- value='<?php echo wp_create_nonce( 'delete_' . $args['name'] ); ?>'/>
219
- <?php }
220
-
221
- /**
222
- * Add the button to add a size
223
- *
224
- * @access public
225
- * @return void
226
- * @author Nicolas Juen
227
- */
228
- public static function addSizeButton() { ?>
229
- <input type="button" class="button-secondary action" id="add_size"
230
- value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes' ); ?>"/>
231
- <?php
232
- }
233
-
234
- /**
235
- * Add the button to get the php for th sizes
236
- *
237
- * @access public
238
- * @return void
239
- * @author Nicolas Juen
240
- */
241
- public static function getPhpButton() { ?>
242
- <input type="button" class="button-secondary action" id="get_php"
243
- value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes' ); ?>"/>
244
- <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes' ); ?> </p>
245
- <code></code>
246
- <?php
247
- }
248
-
249
- /**
250
- * Display the Table of sizes and post types for regenerating
251
- *
252
- * @access public
253
- * @return void
254
- * @author Nicolas Juen
255
- */
256
- public static function thumbnailRegenerate() {
257
- if ( is_file( SIS_DIR . '/templates/options-media.php' ) ) {
258
- include( SIS_DIR . '/templates/options-media.php' );
259
- } else {
260
- esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
261
- }
262
- }
263
-
264
- /**
265
- * Add a size by Ajax
266
- *
267
- * @access public
268
- * @return void
269
- * @author Nicolas Juen
270
- */
271
- public static function a_add_size() {
272
-
273
- // Get the nonce
274
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
275
-
276
- // Get old options
277
- $sizes = (array) get_option( SIS_OPTION, array() );
278
- $croppings = SIS_Admin_Main::get_available_crop();
279
- $croppings[ true ] = '';
280
- $croppings[ false ] = '';
281
-
282
- // Check entries
283
- $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
284
- $height = ! isset( $_POST['height'] ) ? 0 : absint( $_POST['height'] );
285
- $width = ! isset( $_POST['width'] ) ? 0 : absint( $_POST['width'] );
286
- $crop = isset( $_POST['crop'] ) && isset( $croppings[ $_POST['crop'] ] ) ? $_POST['crop'] : false;
287
- $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
288
- $cn = isset( $_POST['customName'] ) && ! empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ) : $name;
289
-
290
- // Check the nonce
291
- if ( ! wp_verify_nonce( $nonce, 'add_size' ) ) {
292
- die( 0 );
293
- }
294
-
295
- // If no name given do not save
296
- if ( empty( $name ) ) {
297
- die( 0 );
298
- }
299
-
300
- // Make values
301
- $values = array( 'custom' => 1, 'w' => $width, 'h' => $height, 'c' => $crop, 's' => $show, 'n' => $cn );
302
-
303
- // If the size have not changed return 2
304
- if ( isset( $sizes[ $name ] ) && $sizes[ $name ] === $values ) {
305
- die( 2 );
306
- }
307
-
308
- // Put the new values
309
- $sizes[ $name ] = $values;
310
-
311
- // display update result
312
- echo (int) update_option( 'custom_image_sizes', $sizes );
313
- die();
314
- }
315
-
316
- /**
317
- * Remove a size by Ajax
318
- *
319
- * @access public
320
- * @return void
321
- * @author Nicolas Juen
322
- */
323
- public static function a_remove_size() {
324
-
325
- // Get old options
326
- $sizes = (array) get_option( SIS_OPTION, array() );
327
-
328
- // Get the nonce and name
329
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
330
- $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
331
-
332
- // Check the nonce
333
- if ( ! wp_verify_nonce( $nonce, 'delete_' . $name ) ) {
334
- die( 0 );
335
- }
336
-
337
- // Remove the size
338
- unset( $sizes[ sanitize_title( $name ) ] );
339
- unset( $sizes[0] );
340
-
341
- // Display the results
342
- echo (int) update_option( SIS_OPTION, $sizes );
343
- die();
344
- }
345
-
346
- /**
347
- * Display the add_image_size for the registered sizes
348
- *
349
- * @access public
350
- * @return void
351
- */
352
- public static function a_get_sizes() {
353
- global $_wp_additional_image_sizes, $wp_version;
354
-
355
- foreach ( get_intermediate_image_sizes() as $s ) {
356
- // Don't make the original sizes
357
- if ( in_array( $s, self::$original ) ) {
358
- continue;
359
- }
360
-
361
- // Set width
362
- $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
363
-
364
- // Set height
365
- $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
366
-
367
- //Set crop
368
- $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
369
-
370
- if ( is_bool( $crop ) || is_numeric( $crop ) || version_compare( $wp_version, '3.9', '<' ) ) {
371
- $crop = ( absint( $crop ) == 0 ) ? 'false' : 'true';
372
- } else {
373
- if ( ! Sis_Admin_Main::is_crop_position( implode( '_', $crop ) ) ) {
374
- $crop = "false";
375
- } else {
376
- $crop = 'array( "' . $crop[0] . '", "' . $crop[1] . '")';
377
- }
378
- }
379
- ?>
380
- add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop; ?> );
381
- <br/>
382
- <?php
383
- }
384
-
385
- die();
386
- }
387
-
388
- /**
389
- *
390
- * Get the media list to regenerate
391
- *
392
- * @param : void
393
- *
394
- * @return void
395
- */
396
- public static function a_get_list() {
397
- /**
398
- * @var $wpdb wpdb
399
- */
400
- global $wpdb;
401
-
402
- // Basic vars
403
- $res = array();
404
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
405
-
406
- // Check the nonce
407
- if ( ! wp_verify_nonce( $nonce, 'getList' ) ) {
408
- SIS_Admin_Main::displayJson();
409
- }
410
-
411
- if ( isset( $_POST['post_types'] ) && ! empty( $_POST['post_types'] ) ) {
412
-
413
- foreach ( $_POST['post_types'] as $key => $type ) {
414
- if ( ! post_type_exists( $type ) ) {
415
- unset( $_POST['post_types'][ $key ] );
416
- }
417
- }
418
-
419
- if ( empty( $_POST['post_types'][ $key ] ) ) {
420
- SIS_Admin_Main::displayJson();
421
- }
422
-
423
- // Get image medias
424
- $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
425
-
426
- // Get all parent from post type
427
- $attachments = $wpdb->get_var( "SELECT COUNT( ID )
428
- FROM $wpdb->posts
429
- WHERE 1 = 1
430
- AND post_type = 'attachment'
431
- $whichmimetype
432
- AND post_parent IN (
433
- SELECT DISTINCT ID
434
- FROM $wpdb->posts
435
- WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
436
- )" );
437
- // Return the Id's and Title of medias
438
- SIS_Admin_Main::displayJson( array( 'total' => $attachments ) );
439
-
440
- } else {
441
- $attachments = get_children( array(
442
- 'post_type' => 'attachment',
443
- 'post_mime_type' => 'image',
444
- 'numberposts' => - 1,
445
- 'post_status' => null,
446
- 'post_parent' => null, // any parent
447
- 'output' => 'ids',
448
- ) );
449
- // Return the Id's and Title of medias
450
- SIS_Admin_Main::displayJson( array( 'total' => count( $attachments ) ) );
451
- }
452
-
453
- }
454
-
455
- /**
456
- * Regenerate the thumbnails ajax action
457
- *
458
- * @return array
459
- *
460
- * @param void
461
- *
462
- * @author Nicolas Juen
463
- */
464
- public static function a_thumbnails_rebuild() {
465
- // Get the nonce
466
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
467
- $offset = isset( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 0;
468
- $post_types = isset( $_POST['post_types'] ) ? $_POST['post_types'] : 'any';
469
- $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
470
-
471
- // Check the nonce
472
- if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
473
- SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
474
- }
475
-
476
- if ( 'any' !== $post_types ) {
477
-
478
- foreach ( $_POST['post_types'] as $key => $type ) {
479
- if ( ! post_type_exists( $type ) ) {
480
- unset( $_POST['post_types'][ $key ] );
481
- }
482
- }
483
-
484
- if ( empty( $_POST['post_types'] ) ) {
485
- SIS_Admin_Main::displayJson();
486
- }
487
-
488
- // Get image medias
489
- $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
490
-
491
- // Get all parent from post type
492
- $attachment = $wpdb->get_var( $wpdb->prepare( "SELECT ID
493
- FROM $wpdb->posts
494
- WHERE 1 = 1
495
- AND post_type = 'attachment'
496
- $whichmimetype
497
- AND post_parent IN (
498
- SELECT DISTINCT ID
499
- FROM $wpdb->posts
500
- WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
501
- )
502
- LIMIT %d,1
503
- ", $offset ) );
504
-
505
- } else {
506
- $attachment = get_posts( array(
507
- 'post_type' => 'attachment',
508
- 'post_mime_type' => 'image',
509
- 'numberposts' => 1,
510
- 'post_status' => 'any',
511
- 'output' => 'object',
512
- 'offset' => $offset,
513
- ) );
514
-
515
- $attachment = ! empty( $attachment ) ? $attachment[0]->ID : 0;
516
- }
517
-
518
- if ( empty( $attachment ) ) {
519
- return array(
520
- 'message' => __( 'Regeneration ended', 'simple-image-sizes' )
521
- );
522
- }
523
- SIS_Admin_Main::displayJson( SIS_Admin_Main::thumbnail_rebuild( $attachment, $thumbnails ) );
524
- }
525
- }
 
 
 
 
1
+ <?php
2
+
3
+ Class SIS_Admin_Media {
4
+
5
+ // Original sizes
6
+ public static $original = array( 'thumbnail', 'medium', 'large' );
7
+
8
+ public function __construct() {
9
+ // Init
10
+ add_action( 'admin_menu', array( __CLASS__, 'init' ) );
11
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
12
+
13
+ // Add ajax action
14
+ // Option page
15
+ add_action( 'wp_ajax_' . 'sis_get_list', array( __CLASS__, 'a_get_list' ) );
16
+ add_action( 'wp_ajax_' . 'sis_rebuild_images', array( __CLASS__, 'a_thumbnails_rebuild' ) );
17
+ add_action( 'wp_ajax_' . 'sis_get_sizes', array( __CLASS__, 'a_get_sizes' ) );
18
+ add_action( 'wp_ajax_' . 'sis_add_size', array( __CLASS__, 'a_add_size' ) );
19
+ add_action( 'wp_ajax_' . 'sis_remove_size', array( __CLASS__, 'a_remove_size' ) );
20
+
21
+ // Add link in plugins list
22
+ add_filter( 'plugin_action_links', array( __CLASS__, 'add_settings_link' ), 10, 2 );
23
+ }
24
+
25
+ /**
26
+ * Register javascripts and css.
27
+ *
28
+ * @access public
29
+ * @return void
30
+ * @author Nicolas Juen
31
+ */
32
+ public static function enqueue_assets( $hook_suffix = '' ) {
33
+ if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
34
+ return;
35
+ }
36
+
37
+ if ( 'options-media.php' == $hook_suffix ) {
38
+ // Add javascript
39
+ wp_enqueue_script( 'sis_js' );
40
+
41
+ // Add CSS
42
+ wp_enqueue_style( 'sis_css' );
43
+
44
+ // Add underscore template
45
+ add_action( 'admin_footer', array( 'SIS_Admin_Main', 'add_template' ) );
46
+ }
47
+ }
48
+
49
+
50
+ /**
51
+ * Add a link to the setting option page
52
+ *
53
+ * @access public
54
+ *
55
+ * @param array $links
56
+ * @param string $file
57
+ *
58
+ * @return string
59
+ * @author Nicolas Juen
60
+ */
61
+ public static function add_settings_link( $links, $file ) {
62
+
63
+ if ( 'simple-image-sizes/simple_image_sizes.php' !== $file ) {
64
+ return $links;
65
+ }
66
+
67
+ $settings_link = '<a href="' . admin_url( 'options-media.php' ) . '"> ' . __( 'Settings', 'simple-image-sizes' ) . ' </a>';
68
+ array_unshift( $links, $settings_link );
69
+
70
+ return $links;
71
+ }
72
+
73
+ /**
74
+ * Init for the option page
75
+ *
76
+ * @access public
77
+ * @return void
78
+ * @author Nicolas Juen
79
+ */
80
+ public static function init() {
81
+ // Check if admin
82
+ if ( ! is_admin() ) {
83
+ return;
84
+ }
85
+
86
+ // Get the image sizes
87
+ global $_wp_additional_image_sizes;
88
+ $options = get_option( SIS_OPTION );
89
+
90
+ // Get the sizes and add the settings
91
+ foreach ( get_intermediate_image_sizes() as $s ) {
92
+ // Don't make the original sizes or numeric sizes that appear
93
+ if ( in_array( $s, self::$original ) || is_integer( $s ) ) {
94
+ continue;
95
+ }
96
+
97
+ // Set width
98
+ $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
99
+
100
+ // Set height
101
+ $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
102
+
103
+ //Set crop
104
+ $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? intval( $_wp_additional_image_sizes[ $s ]['crop'] ) : get_option( "{$s}_crop" );
105
+
106
+ // Add the setting field for this size
107
+ add_settings_field( 'image_size_' . $s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array(
108
+ __CLASS__,
109
+ 'image_sizes'
110
+ ), 'media', 'default', array( 'name' => $s, 'width' => $width, 'height' => $height, 'c' => $crop ) );
111
+ }
112
+
113
+ // Register the setting for media option page
114
+ register_setting( 'media', SIS_OPTION );
115
+
116
+ // Add the button
117
+ add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array(
118
+ __CLASS__,
119
+ 'addSizeButton'
120
+ ), 'media' );
121
+
122
+ // Add php button
123
+ add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array(
124
+ __CLASS__,
125
+ 'getPhpButton'
126
+ ), 'media' );
127
+
128
+ // Add section for the thumbnail regeneration
129
+ add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array(
130
+ __CLASS__,
131
+ 'thumbnailRegenerate'
132
+ ), 'media' );
133
+ }
134
+
135
+ /**
136
+ * Display the row of the image size
137
+ *
138
+ * @access public
139
+ *
140
+ * @param mixed $args
141
+ *
142
+ * @return void
143
+ * @author Nicolas Juen
144
+ */
145
+ public static function image_sizes( $args ) {
146
+
147
+ if ( is_integer( $args['name'] ) ) {
148
+ return;
149
+ }
150
+
151
+ // Get the options
152
+ $sizes = (array) get_option( SIS_OPTION, array() );
153
+
154
+ // Get the vars
155
+ $height = isset( $sizes[ $args['name'] ]['h'] ) ? $sizes[ $args['name'] ]['h'] : $args['height'];
156
+ $width = isset( $sizes[ $args['name'] ]['w'] ) ? $sizes[ $args['name'] ]['w'] : $args['width'];
157
+ $crop = isset( $sizes[ $args['name'] ]['c'] ) && ! empty( $sizes[ $args['name'] ]['c'] ) ? $sizes[ $args['name'] ]['c'] : $args['c'];
158
+ $show = isset( $sizes[ $args['name'] ]['s'] ) && ! empty( $sizes[ $args['name'] ]['s'] ) ? '1' : '0';
159
+ $custom = isset( $sizes[ $args['name'] ]['custom'] ) && ! empty( $sizes[ $args['name'] ]['custom'] ) ? '1' : '0';
160
+ $name = isset( $sizes[ $args['name'] ]['n'] ) && ! empty( $sizes[ $args['name'] ]['n'] ) ? esc_html( $sizes[ $args['name'] ]['n'] ) : esc_html( $args['name'] );
161
+ ?>
162
+ <input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name"/>
163
+ <?php if ( $custom ): ?>
164
+ <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" type="hidden"
165
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" value="1"/>
166
+ <?php else: ?>
167
+ <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" type="hidden"
168
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" value="1"/>
169
+ <?php endif; ?>
170
+ <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>">
171
+ <?php _e( 'Maximum width', 'simple-image-sizes' ); ?>
172
+ <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>" class='w small-text'
173
+ type="number" step='1' min='0'
174
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>"
175
+ base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>"/>
176
+ </label>
177
+ <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>">
178
+ <?php _e( 'Maximum height', 'simple-image-sizes' ); ?>
179
+ <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>" class='h small-text'
180
+ type="number" step='1' min='0'
181
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>"
182
+ base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>"/>
183
+ </label>
184
+ <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>">
185
+ <?php _e( 'Public name', 'simple-image-sizes' ); ?>
186
+ <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>" class='n'
187
+ type="text" id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>"
188
+ base_n='<?php echo $name; ?>' value="<?php echo $name ?>"/>
189
+ </label>
190
+ <span class="size_options">
191
+ <label class="c"
192
+ for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes' ); ?></label>
193
+ <select id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>" class="c crop"
194
+ base_c='<?php echo esc_attr( $crop ); ?>'
195
+ name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>">
196
+ <option
197
+ value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
198
+ <option
199
+ value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
200
+ <?php foreach ( SIS_Admin_Main::get_available_crop() as $crop_position => $label ): ?>
201
+ <option <?php selected( $crop_position, $crop ); ?>
202
+ value="<?php echo esc_attr( $crop_position ) ?>"><?php echo esc_html( $label ); ?></option>
203
+ <?php endforeach; ?>
204
+ </select>
205
+
206
+ <input type='checkbox'
207
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" <?php checked( $show, 1 ) ?>
208
+ class="s show" base_s='<?php echo esc_attr( $show ); ?>'
209
+ name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" value="1"/>
210
+ <label class="s"
211
+ for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>"><?php _e( 'Show in post insertion ?', 'simple-image-sizes' ); ?></label>
212
+ </span>
213
+ <span class="delete_size button-secondary"><?php _e( 'Delete', 'simple-image-sizes' ); ?></span>
214
+ <span class="add_size validate_size button-primary"><?php _e( 'Update', 'simple-image-sizes' ); ?></span>
215
+
216
+ <input type="hidden" class="deleteSize button-primary"
217
+ value='<?php echo wp_create_nonce( 'delete_' . $args['name'] ); ?>'/>
218
+ <?php }
219
+
220
+ /**
221
+ * Add the button to add a size
222
+ *
223
+ * @access public
224
+ * @return void
225
+ * @author Nicolas Juen
226
+ */
227
+ public static function addSizeButton() { ?>
228
+ <input type="button" class="button-secondary action" id="add_size"
229
+ value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes' ); ?>"/>
230
+ <?php
231
+ }
232
+
233
+ /**
234
+ * Add the button to get the php for th sizes
235
+ *
236
+ * @access public
237
+ * @return void
238
+ * @author Nicolas Juen
239
+ */
240
+ public static function getPhpButton() { ?>
241
+ <input type="button" class="button-secondary action" id="get_php"
242
+ value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes' ); ?>"/>
243
+ <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes' ); ?> </p>
244
+ <code></code>
245
+ <?php
246
+ }
247
+
248
+ /**
249
+ * Display the Table of sizes and post types for regenerating
250
+ *
251
+ * @access public
252
+ * @return void
253
+ * @author Nicolas Juen
254
+ */
255
+ public static function thumbnailRegenerate() {
256
+ if ( is_file( SIS_DIR . '/templates/options-media.php' ) ) {
257
+ include( SIS_DIR . '/templates/options-media.php' );
258
+ } else {
259
+ esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
260
+ }
261
+ }
262
+
263
+ /**
264
+ * Add a size by Ajax
265
+ *
266
+ * @access public
267
+ * @return void
268
+ * @author Nicolas Juen
269
+ */
270
+ public static function a_add_size() {
271
+
272
+ // Get the nonce
273
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
274
+
275
+ // Get old options
276
+ $sizes = (array) get_option( SIS_OPTION, array() );
277
+ $croppings = SIS_Admin_Main::get_available_crop();
278
+ $croppings[ true ] = '';
279
+ $croppings[ false ] = '';
280
+
281
+ // Check entries
282
+ $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
283
+ $height = ! isset( $_POST['height'] ) ? 0 : absint( $_POST['height'] );
284
+ $width = ! isset( $_POST['width'] ) ? 0 : absint( $_POST['width'] );
285
+ $crop = isset( $_POST['crop'] ) && isset( $croppings[ $_POST['crop'] ] ) ? $_POST['crop'] : false;
286
+ $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
287
+ $cn = isset( $_POST['customName'] ) && ! empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ) : $name;
288
+
289
+ // Check the nonce
290
+ if ( ! wp_verify_nonce( $nonce, 'add_size' ) ) {
291
+ die( 0 );
292
+ }
293
+
294
+ // If no name given do not save
295
+ if ( empty( $name ) ) {
296
+ die( 0 );
297
+ }
298
+
299
+ // Make values
300
+ $values = array( 'custom' => 1, 'w' => $width, 'h' => $height, 'c' => $crop, 's' => $show, 'n' => $cn );
301
+
302
+ // If the size have not changed return 2
303
+ if ( isset( $sizes[ $name ] ) && $sizes[ $name ] === $values ) {
304
+ die( 2 );
305
+ }
306
+
307
+ // Put the new values
308
+ $sizes[ $name ] = $values;
309
+
310
+ // display update result
311
+ echo (int) update_option( 'custom_image_sizes', $sizes );
312
+ die();
313
+ }
314
+
315
+ /**
316
+ * Remove a size by Ajax
317
+ *
318
+ * @access public
319
+ * @return void
320
+ * @author Nicolas Juen
321
+ */
322
+ public static function a_remove_size() {
323
+
324
+ // Get old options
325
+ $sizes = (array) get_option( SIS_OPTION, array() );
326
+
327
+ // Get the nonce and name
328
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
329
+ $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
330
+
331
+ // Check the nonce
332
+ if ( ! wp_verify_nonce( $nonce, 'delete_' . $name ) ) {
333
+ die( 0 );
334
+ }
335
+
336
+ // Remove the size
337
+ unset( $sizes[ sanitize_title( $name ) ] );
338
+ unset( $sizes[0] );
339
+
340
+ // Display the results
341
+ echo (int) update_option( SIS_OPTION, $sizes );
342
+ die();
343
+ }
344
+
345
+ /**
346
+ * Display the add_image_size for the registered sizes
347
+ *
348
+ * @access public
349
+ * @return void
350
+ */
351
+ public static function a_get_sizes() {
352
+ global $_wp_additional_image_sizes, $wp_version;
353
+
354
+ foreach ( get_intermediate_image_sizes() as $s ) {
355
+ // Don't make the original sizes
356
+ if ( in_array( $s, self::$original ) ) {
357
+ continue;
358
+ }
359
+
360
+ // Set width
361
+ $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
362
+
363
+ // Set height
364
+ $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
365
+
366
+ //Set crop
367
+ $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
368
+
369
+ if ( is_bool( $crop ) || is_numeric( $crop ) || version_compare( $wp_version, '3.9', '<' ) ) {
370
+ $crop = ( absint( $crop ) == 0 ) ? 'false' : 'true';
371
+ } else {
372
+ if ( ! Sis_Admin_Main::is_crop_position( implode( '_', $crop ) ) ) {
373
+ $crop = "false";
374
+ } else {
375
+ $crop = 'array( "' . $crop[0] . '", "' . $crop[1] . '")';
376
+ }
377
+ }
378
+ ?>
379
+ add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop; ?> );
380
+ <br/>
381
+ <?php
382
+ }
383
+
384
+ die();
385
+ }
386
+
387
+ /**
388
+ *
389
+ * Get the media list to regenerate
390
+ *
391
+ * @param : void
392
+ *
393
+ * @return void
394
+ */
395
+ public static function a_get_list() {
396
+ /**
397
+ * @var $wpdb wpdb
398
+ */
399
+ global $wpdb;
400
+
401
+ // Basic vars
402
+ $res = array();
403
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
404
+
405
+ // Check the nonce
406
+ if ( ! wp_verify_nonce( $nonce, 'getList' ) ) {
407
+ SIS_Admin_Main::displayJson();
408
+ }
409
+
410
+ if ( isset( $_POST['post_types'] ) && ! empty( $_POST['post_types'] ) ) {
411
+
412
+ foreach ( $_POST['post_types'] as $key => $type ) {
413
+ if ( ! post_type_exists( $type ) ) {
414
+ unset( $_POST['post_types'][ $key ] );
415
+ }
416
+ }
417
+
418
+ if ( empty( $_POST['post_types'][ $key ] ) ) {
419
+ SIS_Admin_Main::displayJson();
420
+ }
421
+
422
+ // Get image medias
423
+ $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
424
+
425
+ // Get all parent from post type
426
+ $attachments = $wpdb->get_var( "SELECT COUNT( ID )
427
+ FROM $wpdb->posts
428
+ WHERE 1 = 1
429
+ AND post_type = 'attachment'
430
+ $whichmimetype
431
+ AND post_parent IN (
432
+ SELECT DISTINCT ID
433
+ FROM $wpdb->posts
434
+ WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
435
+ )" );
436
+ // Return the Id's and Title of medias
437
+ SIS_Admin_Main::displayJson( array( 'total' => $attachments ) );
438
+
439
+ } else {
440
+ $attachments = get_children( array(
441
+ 'post_type' => 'attachment',
442
+ 'post_mime_type' => 'image',
443
+ 'numberposts' => - 1,
444
+ 'post_status' => null,
445
+ 'post_parent' => null, // any parent
446
+ 'output' => 'ids',
447
+ ) );
448
+ // Return the Id's and Title of medias
449
+ SIS_Admin_Main::displayJson( array( 'total' => count( $attachments ) ) );
450
+ }
451
+
452
+ }
453
+
454
+ /**
455
+ * Regenerate the thumbnails ajax action
456
+ *
457
+ * @return array
458
+ *
459
+ * @param void
460
+ *
461
+ * @author Nicolas Juen
462
+ */
463
+ public static function a_thumbnails_rebuild() {
464
+ /**
465
+ * @var $wpdb wpdb
466
+ */
467
+ global $wpdb;
468
+
469
+ // Get the nonce
470
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
471
+ $offset = isset( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 0;
472
+ $post_types = isset( $_POST['post_types'] ) ? $_POST['post_types'] : 'any';
473
+ $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
474
+
475
+ // Check the nonce
476
+ if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
477
+ SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
478
+ }
479
+
480
+ if ( 'any' !== $post_types ) {
481
+
482
+ foreach ( $_POST['post_types'] as $key => $type ) {
483
+ if ( ! post_type_exists( $type ) ) {
484
+ unset( $_POST['post_types'][ $key ] );
485
+ }
486
+ }
487
+
488
+ if ( empty( $_POST['post_types'] ) ) {
489
+ SIS_Admin_Main::displayJson();
490
+ }
491
+
492
+ // Get image medias
493
+ $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
494
+
495
+ // Get all parent from post type
496
+ $attachment = $wpdb->get_var( $wpdb->prepare( "SELECT ID
497
+ FROM $wpdb->posts
498
+ WHERE 1 = 1
499
+ AND post_type = 'attachment'
500
+ $whichmimetype
501
+ AND post_parent IN (
502
+ SELECT DISTINCT ID
503
+ FROM $wpdb->posts
504
+ WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
505
+ )
506
+ LIMIT %d,1
507
+ ", $offset ) );
508
+
509
+ } else {
510
+ $attachment = get_posts( array(
511
+ 'post_type' => 'attachment',
512
+ 'post_mime_type' => 'image',
513
+ 'numberposts' => 1,
514
+ 'post_status' => 'any',
515
+ 'output' => 'object',
516
+ 'offset' => $offset,
517
+ ) );
518
+
519
+ $attachment = ! empty( $attachment ) ? $attachment[0]->ID : 0;
520
+ }
521
+
522
+ if ( empty( $attachment ) ) {
523
+ return array(
524
+ 'message' => __( 'Regeneration ended', 'simple-image-sizes' )
525
+ );
526
+ }
527
+ SIS_Admin_Main::displayJson( SIS_Admin_Main::thumbnail_rebuild( $attachment, $thumbnails ) );
528
+ }
529
+ }
classes/admin/post.php CHANGED
@@ -1,266 +1,263 @@
1
- <?php
2
-
3
- Class SIS_Admin_Post {
4
- public function __construct() {
5
- // Add image sizes in the form, check if 3.3 is installed or not
6
- if ( ! function_exists( 'is_main_query' ) ) {
7
- add_filter( 'attachment_fields_to_edit', array(
8
- __CLASS__,
9
- 'sizes_in_form'
10
- ), 11, 2 ); // Add our sizes to media forms
11
- } else {
12
- add_filter( 'image_size_names_choose', array( __CLASS__, 'add_thumbnail_name' ) );
13
- }
14
-
15
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
16
-
17
- // Rebuilt the image
18
- add_action( 'wp_ajax_' . 'sis_rebuild_image', array( __CLASS__, 'a_thumbnail_rebuild' ) );
19
-
20
- // Add action in media row quick actions
21
- add_filter( 'media_row_actions', array( __CLASS__, 'add_actions_list' ), 10, 2 );
22
-
23
- // Add filter for the Media single
24
- add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'add_field_regenerate' ), 9, 2 );
25
- }
26
-
27
- /**
28
- * Register javascripts and css.
29
- *
30
- * @access public
31
- * @return void
32
- * @author Nicolas Juen
33
- */
34
- public static function enqueue_assets( $hook_suffix = '' ) {
35
- if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
36
- return false;
37
- }
38
-
39
- if ( 'upload.php' == $hook_suffix || ( 'post.php' == $hook_suffix && isset( $_GET['post'] ) && isset( $_GET['action'] ) && 'edit' == $_GET['action'] ) ) {
40
- // Add javascript
41
- wp_enqueue_script( 'sis_js_attachments' );
42
-
43
- // Add underscore template
44
- add_action( 'admin_footer', array( 'SIS_Admin_Main', 'add_template' ) );
45
- }
46
- }
47
-
48
- /**
49
- * Rebuild the image
50
- *
51
- * @access public
52
- * @return void
53
- * @author Nicolas Juen
54
- */
55
- public static function a_thumbnail_rebuild() {
56
- // Get the nonce
57
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
58
-
59
- // Time a the begining
60
- timer_start();
61
-
62
- // Get the thumbnails
63
- $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
64
-
65
- // Check the nonce
66
- if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
67
- SIS_Admin_Main::displayJson( array( 'error' => _e( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
68
- }
69
-
70
- // Get the id
71
- $id = isset( $_POST['id'] ) ? $_POST['id'] : 0;
72
- SIS_Admin_Main::displayJson( SIS_Admin_Main::thumbnail_rebuild( $id, $thumbnails ) );
73
- }
74
-
75
- /**
76
- * Add the custom sizes to the image sizes in article edition
77
- *
78
- * @access public
79
- *
80
- * @param array $form_fields
81
- * @param object $post
82
- *
83
- * @return string
84
- * @author Nicolas Juen
85
- * @author Additional Image Sizes (zui)
86
- */
87
- public static function sizes_in_form( $form_fields, $post ) {
88
- // Protect from being view in Media editor where there are no sizes
89
- if ( ! isset( $form_fields['image-size'] ) ) {
90
- return $form_fields;
91
- }
92
-
93
- $out = null;
94
- $size_names = array();
95
- $sizes_custom = get_option( SIS_OPTION, array() );
96
-
97
- if ( is_array( $sizes_custom ) ) {
98
- foreach ( $sizes_custom as $key => $value ) {
99
- if ( isset( $value['s'] ) && $value['s'] == 1 ) {
100
- $size_names[ $key ] = self::_get_thumbnail_name( $key );;
101
- }
102
- }
103
- }
104
- foreach ( $size_names as $size => $label ) {
105
- $downsize = image_downsize( $post->ID, $size );
106
-
107
- // is this size selectable?
108
- $enabled = ( $downsize[3] || 'full' == $size );
109
- $css_id = "image-size-{$size}-{$post->ID}";
110
-
111
- // We must do a clumsy search of the existing html to determine is something has been checked yet
112
- if ( false === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
113
- if ( empty( $check ) ) {
114
- $check = get_user_setting( 'imgsize' );
115
- } // See if they checked a custom size last time
116
-
117
- $checked = '';
118
-
119
- // if this size is the default but that's not available, don't select it
120
- if ( $size == $check || str_replace( " ", "", $size ) == $check ) {
121
- if ( $enabled ) {
122
- $checked = " checked='checked'";
123
- } else {
124
- $check = '';
125
- }
126
- } elseif ( ! $check && $enabled && 'thumbnail' != $size ) {
127
- // if $check is not enabled, default to the first available size that's bigger than a thumbnail
128
- $check = $size;
129
- $checked = " checked='checked'";
130
- }
131
- }
132
- $html = "<div class='image-size-item' style='min-height: 50px; margin-top: 18px;'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
133
-
134
- $html .= "<label for='{$css_id}'>$label</label>";
135
- // only show the dimensions if that choice is available
136
- if ( $enabled ) {
137
- $html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d&nbsp;&times;&nbsp;%d)", $downsize[1], $downsize[2] ) . "</label>";
138
- }
139
-
140
- $html .= '</div>';
141
-
142
- $out .= $html;
143
- }
144
- $form_fields['image-size']['html'] .= $out;
145
-
146
- return $form_fields;
147
- }
148
-
149
- /**
150
- * Add the thumbnail name in the post insertion, based on new WP filter
151
- *
152
- * @access public
153
- *
154
- * @param array $sizes
155
- *
156
- * @return array
157
- * @since 2.3
158
- * @author Nicolas Juen
159
- * @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
160
- */
161
- public static function add_thumbnail_name( $sizes ) {
162
- // Get options
163
- $sizes_custom = get_option( SIS_OPTION, array() );
164
- // init size array
165
- $addsizes = array();
166
-
167
- // check there is custom sizes
168
- if ( is_array( $sizes_custom ) && ! empty( $sizes_custom ) ) {
169
- foreach ( $sizes_custom as $key => $value ) {
170
- // If we show this size in the admin
171
- if ( isset( $value['s'] ) && 1 == $value['s'] ) {
172
- $addsizes[ $key ] = self::_get_thumbnail_name( $key );
173
- }
174
- }
175
- }
176
-
177
- // Merge the two array
178
- $newsizes = array_merge( $sizes, $addsizes );
179
-
180
- // Add new size
181
- return $newsizes;
182
- }
183
-
184
- /**
185
- * Get a thumbnail name from its slug
186
- *
187
- * @access private
188
- *
189
- * @param string $thumbnailSlug : the slug of the thumbnail
190
- *
191
- * @return array
192
- * @since 2.3
193
- * @author Nicolas Juen
194
- */
195
- private static function _get_thumbnail_name( $thumbnailSlug = '' ) {
196
-
197
- // get the options
198
- $sizes_custom = get_option( SIS_OPTION );
199
-
200
- if ( ! isset( $sizes_custom[ $thumbnailSlug ] ) ) {
201
- // return slug if not found
202
- return $thumbnailSlug;
203
- }
204
-
205
- // If the name exists return it, slug by default
206
- if ( isset( $sizes_custom[ $thumbnailSlug ]['n'] ) && ! empty( $sizes_custom[ $thumbnailSlug ]['n'] ) ) {
207
- return $sizes_custom[ $thumbnailSlug ]['n'];
208
- }
209
-
210
- return $thumbnailSlug;
211
- }
212
-
213
-
214
- /**
215
- * Add action in media row
216
- *
217
- * @since 2.2
218
- * @access public
219
- * @return $actions : array of actions and content to display
220
- * @author Nicolas Juen
221
- */
222
- public static function add_actions_list( $actions, $object ) {
223
- if ( ! wp_attachment_is_image( $object->ID ) ) {
224
- return $actions;
225
- }
226
- // Add action for regeneration
227
- $actions['sis-regenerate'] = "<a href='#' data-id='" . $object->ID . "' class='sis-regenerate-one'>" . __( 'Regenerate thumbnails', 'simple-image-sizes' ) . "</a>";
228
-
229
- // Return actions
230
- return $actions;
231
- }
232
-
233
-
234
- /**
235
- * Get a thumbnail name from its slug
236
- *
237
- * @access public
238
- *
239
- * @param array $fields : the fields of the media
240
- * @param object $post : the post object
241
- *
242
- * @return array
243
- * @since 2.3.1
244
- * @author Nicolas Juen
245
- */
246
- public static function add_field_regenerate( $fields, $post ) {
247
- // Check this is an image
248
- if ( false === strpos( $post->post_mime_type, 'image' ) ) {
249
- return $fields;
250
- }
251
-
252
- $fields['sis-regenerate'] = array(
253
- 'label' => __( 'Regenerate Thumbnails', 'simple-image-sizes' ),
254
- 'input' => 'html',
255
- 'html' => '
256
- <input type="button" data-id="' . $post->ID . '" class="button title sis-regenerate-one" value="' . __( 'Regenerate Thumbnails', 'simple-image-sizes' ) . '" />
257
- <span class="spinner"></span>
258
- <span class="title"><em></em></span>
259
- <input type="hidden" class="regen" value="' . wp_create_nonce( 'regen' ) . '" />',
260
- 'show_in_edit' => true,
261
- 'show_in_modal' => false,
262
- );
263
-
264
- return $fields;
265
- }
266
  }
1
+ <?php
2
+
3
+ Class SIS_Admin_Post {
4
+ public function __construct() {
5
+ // Add image sizes in the form, check if 3.3 is installed or not
6
+ if ( ! function_exists( 'is_main_query' ) ) {
7
+ add_filter( 'attachment_fields_to_edit', array(
8
+ __CLASS__,
9
+ 'sizes_in_form'
10
+ ), 11, 2 ); // Add our sizes to media forms
11
+ } else {
12
+ add_filter( 'image_size_names_choose', array( __CLASS__, 'add_thumbnail_name' ) );
13
+ }
14
+
15
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
16
+
17
+ // Rebuilt the image
18
+ add_action( 'wp_ajax_' . 'sis_rebuild_image', array( __CLASS__, 'a_thumbnail_rebuild' ) );
19
+
20
+ // Add action in media row quick actions
21
+ add_filter( 'media_row_actions', array( __CLASS__, 'add_actions_list' ), 10, 2 );
22
+
23
+ // Add filter for the Media single
24
+ add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'add_field_regenerate' ), 9, 2 );
25
+ }
26
+
27
+ /**
28
+ * Register javascripts and css.
29
+ *
30
+ * @access public
31
+ * @return void
32
+ * @author Nicolas Juen
33
+ */
34
+ public static function enqueue_assets( $hook_suffix = '' ) {
35
+ if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
36
+ return;
37
+ }
38
+
39
+ if ( 'upload.php' == $hook_suffix || ( 'post.php' == $hook_suffix && isset( $_GET['post'] ) && isset( $_GET['action'] ) && 'edit' == $_GET['action'] ) ) {
40
+ // Add javascript
41
+ wp_enqueue_script( 'sis_js_attachments' );
42
+
43
+ // Add underscore template
44
+ add_action( 'admin_footer', array( 'SIS_Admin_Main', 'add_template' ) );
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Rebuild the image
50
+ *
51
+ * @access public
52
+ * @return void
53
+ * @author Nicolas Juen
54
+ */
55
+ public static function a_thumbnail_rebuild() {
56
+ // Get the nonce
57
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
58
+
59
+ // Get the thumbnails
60
+ $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
61
+
62
+ // Check the nonce
63
+ if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
64
+ SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
65
+ }
66
+
67
+ // Get the id
68
+ $id = isset( $_POST['id'] ) ? $_POST['id'] : 0;
69
+ SIS_Admin_Main::displayJson( SIS_Admin_Main::thumbnail_rebuild( $id, $thumbnails ) );
70
+ }
71
+
72
+ /**
73
+ * Add the custom sizes to the image sizes in article edition
74
+ *
75
+ * @access public
76
+ *
77
+ * @param array $form_fields
78
+ * @param object $post
79
+ *
80
+ * @return string
81
+ * @author Nicolas Juen
82
+ * @author Additional Image Sizes (zui)
83
+ */
84
+ public static function sizes_in_form( $form_fields, $post ) {
85
+ // Protect from being view in Media editor where there are no sizes
86
+ if ( ! isset( $form_fields['image-size'] ) ) {
87
+ return $form_fields;
88
+ }
89
+
90
+ $out = null;
91
+ $size_names = array();
92
+ $sizes_custom = get_option( SIS_OPTION, array() );
93
+
94
+ if ( is_array( $sizes_custom ) ) {
95
+ foreach ( $sizes_custom as $key => $value ) {
96
+ if ( isset( $value['s'] ) && $value['s'] == 1 ) {
97
+ $size_names[ $key ] = self::_get_thumbnail_name( $key );;
98
+ }
99
+ }
100
+ }
101
+ foreach ( $size_names as $size => $label ) {
102
+ $downsize = image_downsize( $post->ID, $size );
103
+
104
+ // is this size selectable?
105
+ $enabled = ( $downsize[3] || 'full' == $size );
106
+ $css_id = "image-size-{$size}-{$post->ID}";
107
+
108
+ // We must do a clumsy search of the existing html to determine is something has been checked yet
109
+ if ( false === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
110
+ if ( empty( $check ) ) {
111
+ $check = get_user_setting( 'imgsize' );
112
+ } // See if they checked a custom size last time
113
+
114
+ $checked = '';
115
+
116
+ // if this size is the default but that's not available, don't select it
117
+ if ( $size == $check || str_replace( " ", "", $size ) == $check ) {
118
+ if ( $enabled ) {
119
+ $checked = " checked='checked'";
120
+ } else {
121
+ $check = '';
122
+ }
123
+ } elseif ( ! $check && $enabled && 'thumbnail' != $size ) {
124
+ // if $check is not enabled, default to the first available size that's bigger than a thumbnail
125
+ $check = $size;
126
+ $checked = " checked='checked'";
127
+ }
128
+ }
129
+ $html = "<div class='image-size-item' style='min-height: 50px; margin-top: 18px;'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
130
+
131
+ $html .= "<label for='{$css_id}'>$label</label>";
132
+ // only show the dimensions if that choice is available
133
+ if ( $enabled ) {
134
+ $html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d&nbsp;&times;&nbsp;%d)", $downsize[1], $downsize[2] ) . "</label>";
135
+ }
136
+
137
+ $html .= '</div>';
138
+
139
+ $out .= $html;
140
+ }
141
+ $form_fields['image-size']['html'] .= $out;
142
+
143
+ return $form_fields;
144
+ }
145
+
146
+ /**
147
+ * Add the thumbnail name in the post insertion, based on new WP filter
148
+ *
149
+ * @access public
150
+ *
151
+ * @param array $sizes
152
+ *
153
+ * @return array
154
+ * @since 2.3
155
+ * @author Nicolas Juen
156
+ * @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
157
+ */
158
+ public static function add_thumbnail_name( $sizes ) {
159
+ // Get options
160
+ $sizes_custom = get_option( SIS_OPTION, array() );
161
+ // init size array
162
+ $addsizes = array();
163
+
164
+ // check there is custom sizes
165
+ if ( is_array( $sizes_custom ) && ! empty( $sizes_custom ) ) {
166
+ foreach ( $sizes_custom as $key => $value ) {
167
+ // If we show this size in the admin
168
+ if ( isset( $value['s'] ) && 1 == $value['s'] ) {
169
+ $addsizes[ $key ] = self::_get_thumbnail_name( $key );
170
+ }
171
+ }
172
+ }
173
+
174
+ // Merge the two array
175
+ $newsizes = array_merge( $sizes, $addsizes );
176
+
177
+ // Add new size
178
+ return $newsizes;
179
+ }
180
+
181
+ /**
182
+ * Get a thumbnail name from its slug
183
+ *
184
+ * @access private
185
+ *
186
+ * @param string $thumbnailSlug : the slug of the thumbnail
187
+ *
188
+ * @return array
189
+ * @since 2.3
190
+ * @author Nicolas Juen
191
+ */
192
+ private static function _get_thumbnail_name( $thumbnailSlug = '' ) {
193
+
194
+ // get the options
195
+ $sizes_custom = get_option( SIS_OPTION );
196
+
197
+ if ( ! isset( $sizes_custom[ $thumbnailSlug ] ) ) {
198
+ // return slug if not found
199
+ return $thumbnailSlug;
200
+ }
201
+
202
+ // If the name exists return it, slug by default
203
+ if ( isset( $sizes_custom[ $thumbnailSlug ]['n'] ) && ! empty( $sizes_custom[ $thumbnailSlug ]['n'] ) ) {
204
+ return $sizes_custom[ $thumbnailSlug ]['n'];
205
+ }
206
+
207
+ return $thumbnailSlug;
208
+ }
209
+
210
+
211
+ /**
212
+ * Add action in media row
213
+ *
214
+ * @since 2.2
215
+ * @access public
216
+ * @return $actions : array of actions and content to display
217
+ * @author Nicolas Juen
218
+ */
219
+ public static function add_actions_list( $actions, $object ) {
220
+ if ( ! wp_attachment_is_image( $object->ID ) ) {
221
+ return $actions;
222
+ }
223
+ // Add action for regeneration
224
+ $actions['sis-regenerate'] = "<a href='#' data-id='" . $object->ID . "' class='sis-regenerate-one'>" . __( 'Regenerate thumbnails', 'simple-image-sizes' ) . "</a>";
225
+
226
+ // Return actions
227
+ return $actions;
228
+ }
229
+
230
+
231
+ /**
232
+ * Get a thumbnail name from its slug
233
+ *
234
+ * @access public
235
+ *
236
+ * @param array $fields : the fields of the media
237
+ * @param object $post : the post object
238
+ *
239
+ * @return array
240
+ * @since 2.3.1
241
+ * @author Nicolas Juen
242
+ */
243
+ public static function add_field_regenerate( $fields, $post ) {
244
+ // Check this is an image
245
+ if ( false === strpos( $post->post_mime_type, 'image' ) ) {
246
+ return $fields;
247
+ }
248
+
249
+ $fields['sis-regenerate'] = array(
250
+ 'label' => __( 'Regenerate Thumbnails', 'simple-image-sizes' ),
251
+ 'input' => 'html',
252
+ 'html' => '
253
+ <input type="button" data-id="' . $post->ID . '" class="button title sis-regenerate-one" value="' . __( 'Regenerate Thumbnails', 'simple-image-sizes' ) . '" />
254
+ <span class="spinner"></span>
255
+ <span class="title"><em></em></span>
256
+ <input type="hidden" class="regen" value="' . wp_create_nonce( 'regen' ) . '" />',
257
+ 'show_in_edit' => true,
258
+ 'show_in_modal' => false,
259
+ );
260
+
261
+ return $fields;
262
+ }
 
 
 
263
  }
classes/main.php CHANGED
@@ -1,61 +1,60 @@
1
- <?php
2
-
3
- Class SIS_Client {
4
-
5
- // Set the original
6
- var $original = array( 'thumbnail', 'medium', 'large' );
7
-
8
- function __construct() {
9
-
10
- // Make new image sizes
11
- add_action( 'init', array( __CLASS__, 'init' ), 1 );
12
-
13
- // Add translation
14
- add_action( 'init', array( __CLASS__, 'init_translation' ), 2 );
15
- }
16
-
17
- /**
18
- * Override the images by the plugin images
19
- *
20
- * @access public
21
- * @return void
22
- * @author Nicolas Juen
23
- */
24
- public static function init() {
25
- // Get inital options
26
- $sizes = get_option( SIS_OPTION, array() );
27
-
28
- // Return false if empty
29
- if ( empty( $sizes ) || ! is_array( $sizes ) ) {
30
- return;
31
- }
32
-
33
- // Set the new sizes
34
- foreach ( $sizes as $name => $size ) {
35
- if ( empty( $size ) || ! isset( $size['w'] ) || ! isset( $size['h'] ) ) {
36
- continue;
37
- }
38
-
39
- $crop = ( isset( $size['c'] ) && ! empty( $size['c'] ) ) ? $size['c'] : false;
40
-
41
- if ( is_string( $crop ) ) {
42
- $crop = explode( '_', $crop );
43
- }
44
-
45
- // Add the images sizes
46
- add_image_size( $name, $size['w'], $size['h'], $crop );
47
- }
48
- }
49
-
50
- /**
51
- * Load the plugin text domain
52
- *
53
- * @param void
54
- *
55
- * @return void
56
- * @author Nicolas Juen
57
- */
58
- public static function init_translation() {
59
- load_plugin_textdomain( 'simple-image-sizes', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
60
- }
61
  }
1
+ <?php
2
+
3
+ Class SIS_Client {
4
+
5
+ // Set the original
6
+ var $original = array( 'thumbnail', 'medium', 'large' );
7
+
8
+ function __construct() {
9
+ // Make new image sizes
10
+ add_action( 'after_setup_theme', array( __CLASS__, 'after_setup_theme' ), 1 );
11
+
12
+ // Add translation
13
+ add_action( 'init', array( __CLASS__, 'init_translation' ), 2 );
14
+ }
15
+
16
+ /**
17
+ * Override the images by the plugin images
18
+ *
19
+ * @access public
20
+ * @return void
21
+ * @author Nicolas Juen
22
+ */
23
+ public static function after_setup_theme() {
24
+ // Get inital options
25
+ $sizes = get_option( SIS_OPTION, array() );
26
+
27
+ // Return false if empty
28
+ if ( empty( $sizes ) || ! is_array( $sizes ) ) {
29
+ return;
30
+ }
31
+
32
+ // Set the new sizes
33
+ foreach ( $sizes as $name => $size ) {
34
+ if ( empty( $size ) || ! isset( $size['w'] ) || ! isset( $size['h'] ) ) {
35
+ continue;
36
+ }
37
+
38
+ $crop = ( isset( $size['c'] ) && ! empty( $size['c'] ) ) ? $size['c'] : false;
39
+
40
+ if ( is_string( $crop ) ) {
41
+ $crop = explode( '_', $crop );
42
+ }
43
+
44
+ // Add the images sizes
45
+ add_image_size( $name, $size['w'], $size['h'], $crop );
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Load the plugin text domain
51
+ *
52
+ * @param void
53
+ *
54
+ * @return void
55
+ * @author Nicolas Juen
56
+ */
57
+ public static function init_translation() {
58
+ load_plugin_textdomain( 'simple-image-sizes', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
59
+ }
 
60
  }
languages/simple-image-sizes-de_DE.po CHANGED
@@ -1,367 +1,367 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: \n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-04-20 15:24+0100\n"
6
- "PO-Revision-Date: 2014-04-20 15:32+0100\n"
7
- "Last-Translator: Nicolas Juen <nicolas.juen@gmail.com>\n"
8
- "Language-Team: LANGUAGE <LL@li.org>\n"
9
- "Language: de_DE\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Poedit-SourceCharset: utf-8\n"
15
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
- "_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"
17
- "X-Poedit-Basepath: .\n"
18
- "X-Textdomain-Support: yes\n"
19
- "X-Generator: Poedit 1.6.3\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
-
22
- # @ sis
23
- #: ../classes/admin/main.php:39
24
- msgid "Reading attachments..."
25
- msgstr "Lese Anhänge…"
26
-
27
- # @ sis
28
- #: ../classes/admin/main.php:40 ../classes/admin/media.php:154
29
- msgid "Maximum width"
30
- msgstr "Maximale Breite"
31
-
32
- # @ sis
33
- #: ../classes/admin/main.php:41 ../classes/admin/media.php:158
34
- msgid "Maximum height"
35
- msgstr "Maximale Höhe"
36
-
37
- # @ sis
38
- #: ../classes/admin/main.php:42
39
- msgid "Crop"
40
- msgstr ""
41
-
42
- # @ sis
43
- #: ../classes/admin/main.php:43
44
- msgid "yes"
45
- msgstr "ja"
46
-
47
- # @ sis
48
- #: ../classes/admin/main.php:44
49
- msgid "no"
50
- msgstr "nein"
51
-
52
- # @ sis
53
- #: ../classes/admin/main.php:45 ../classes/admin/media.php:176
54
- msgid "Show in post insertion ?"
55
- msgstr "Beim Einfügen in den Beitrag anzeigen?"
56
-
57
- # @ sis
58
- #: ../classes/admin/main.php:46
59
- msgid " of "
60
- msgstr "von"
61
-
62
- # @ sis
63
- #: ../classes/admin/main.php:47
64
- msgid " or "
65
- msgstr "oder"
66
-
67
- # @ sis
68
- #: ../classes/admin/main.php:48
69
- msgid " before the end."
70
- msgstr "vor dem Ende."
71
-
72
- # @ sis
73
- #: ../classes/admin/main.php:49 ../classes/admin/media.php:178
74
- msgid "Delete"
75
- msgstr "Löschen"
76
-
77
- # @ sis
78
- #: ../classes/admin/main.php:50
79
- msgid "No media in your site to regenerate !"
80
- msgstr "Keine Medien neu zu generieren!"
81
-
82
- # @ sis
83
- #: ../classes/admin/main.php:51
84
- msgid "Regenerating "
85
- msgstr "Neu generieren"
86
-
87
- # @ sis
88
- #: ../classes/admin/main.php:52
89
- msgid "Regenerate "
90
- msgstr ""
91
-
92
- # @ sis
93
- #: ../classes/admin/main.php:53
94
- msgid "Validate image size name"
95
- msgstr "Bildgrößenbezeichnung überprüfen"
96
-
97
- # @ sis
98
- #: ../classes/admin/main.php:54
99
- msgid "Done."
100
- msgstr "Fertig."
101
-
102
- # @ sis
103
- #: ../classes/admin/main.php:55
104
- msgid "Size"
105
- msgstr "Bildgröße"
106
-
107
- # @ sis
108
- #: ../classes/admin/main.php:56
109
- msgid ""
110
- "Don't use the basic Wordpress thumbnail size name, use the form above to "
111
- "edit them"
112
- msgstr ""
113
- "Nutze nicht die vorgegebene Thumbnail-Bezeichnung in WordPress! Nutze das "
114
- "Formular, um diese zu bearbeiten."
115
-
116
- # @ sis
117
- #: ../classes/admin/main.php:57
118
- msgid "This size is already registered, edit it instead of recreating it."
119
- msgstr ""
120
- "Die Bildgröße existiert bereits. Du kannst sie bearbeiten, anstatt sie "
121
- "doppelt anzulegen."
122
-
123
- # @ sis
124
- #: ../classes/admin/main.php:58
125
- msgid "Do you really want to delete these size ?"
126
- msgstr "Willst du diese Bildgröße/n wirklich löschen?"
127
-
128
- # @ sis
129
- #: ../classes/admin/main.php:59 ../classes/admin/media.php:179
130
- msgid "Update"
131
- msgstr "Aktualisieren"
132
-
133
- # @ sis
134
- #: ../classes/admin/main.php:60
135
- msgid "Error requesting page"
136
- msgstr "Fehler beim Abruf der Seite"
137
-
138
- # @ sis
139
- #: ../classes/admin/main.php:61
140
- msgid "images have been regenerated !"
141
- msgstr "Bilder wurden neu generiert!"
142
-
143
- # @ sis
144
- #: ../classes/admin/main.php:62
145
- msgid "Validate"
146
- msgstr "Überprüfen"
147
-
148
- # @ sis
149
- #: ../classes/admin/main.php:63
150
- msgid " started at"
151
- msgstr "begonnen: "
152
-
153
- # @ sis
154
- #: ../classes/admin/main.php:64 ../classes/admin/media.php:162
155
- msgid "Public name"
156
- msgstr ""
157
-
158
- # @ sis
159
- #: ../classes/admin/main.php:65
160
- msgid " finished at :"
161
- msgstr "beendet: "
162
-
163
- # @ sis
164
- #: ../classes/admin/main.php:66
165
- msgid ""
166
- "Error during the php treatment, be sure to not have php errors in your page"
167
- msgstr ""
168
- "Fehler während des PHP-Durchlaufs! Stelle sicher, dass sich keine PHP-Fehler "
169
- "in deiner Seite befinden."
170
-
171
- # @ sis
172
- #: ../classes/admin/main.php:67
173
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
174
- msgstr ""
175
- "Deine veränderten Bildgrößen wurden noch nicht gespeichert. Trotzdem "
176
- "fortfahren?"
177
-
178
- # @ sis
179
- #: ../classes/admin/main.php:68
180
- #, php-format
181
- msgid "This image has been regenerated in %s seconds"
182
- msgstr "Dieses Bild wurde neu generiert in %s Sekunden."
183
-
184
- # @ sis
185
- #: ../classes/admin/main.php:91
186
- msgid "No id given in POST datas."
187
- msgstr "Keine ID in den POST-Daten gegeben."
188
-
189
- # @ sis
190
- #: ../classes/admin/main.php:104
191
- #, php-format
192
- msgid ""
193
- "This file already exists in this size and have not been regenerated :<br/><a "
194
- "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
195
- msgstr ""
196
-
197
- # @ sis
198
- #: ../classes/admin/main.php:111
199
- #, php-format
200
- msgid ""
201
- "This file does not exists and have not been regenerated :<br/><a target="
202
- "\"_blank\" href=\"%1$s\" >%2$s</a>"
203
- msgstr ""
204
- "Diese Datei existiert nicht und wurde nicht neu generiert:<br/><a target="
205
- "\"_blank\" href=\"%1$s\" >%2$s</a>"
206
-
207
- #: ../classes/admin/main.php:158
208
- msgid "Left"
209
- msgstr ""
210
-
211
- #: ../classes/admin/main.php:159
212
- msgid "Center"
213
- msgstr ""
214
-
215
- # @ sis
216
- #: ../classes/admin/main.php:160
217
- msgid "Right"
218
- msgstr ""
219
-
220
- #: ../classes/admin/main.php:164
221
- msgid "top"
222
- msgstr ""
223
-
224
- #: ../classes/admin/main.php:165
225
- msgid "center"
226
- msgstr ""
227
-
228
- #: ../classes/admin/main.php:166
229
- msgid "bottom"
230
- msgstr ""
231
-
232
- # @ sis
233
- #: ../classes/admin/media.php:66
234
- msgid "Settings"
235
- msgstr "Einstellungen"
236
-
237
- # @ sis
238
- #: ../classes/admin/media.php:106
239
- #, php-format
240
- msgid "%s size"
241
- msgstr "Bildgröße „%s“"
242
-
243
- # @ sis
244
- #: ../classes/admin/media.php:113
245
- msgid "Add a new size"
246
- msgstr "Neue Bildgröße hinzufügen"
247
-
248
- # @ sis
249
- #: ../classes/admin/media.php:116
250
- msgid "Get php for theme"
251
- msgstr "PHP für dein Theme generieren"
252
-
253
- # @ sis
254
- #: ../classes/admin/media.php:119
255
- msgid "Thumbnail regeneration"
256
- msgstr "Artikelbilder neu generieren"
257
-
258
- #: ../classes/admin/media.php:155 ../classes/admin/media.php:157
259
- #: ../classes/admin/media.php:159
260
- msgid "custom_image_sizes["
261
- msgstr ""
262
-
263
- #: ../classes/admin/media.php:166
264
- msgid "Cropping"
265
- msgstr ""
266
-
267
- #: ../classes/admin/media.php:168 ../templates/options-media.php:39
268
- msgid "No"
269
- msgstr ""
270
-
271
- # @ sis
272
- #: ../classes/admin/media.php:169 ../templates/options-media.php:39
273
- msgid "Yes"
274
- msgstr "Ja"
275
-
276
- # @ sis
277
- #: ../classes/admin/media.php:192
278
- msgid "Add a new size of thumbnail"
279
- msgstr "Neue Bildgröße für Thumbnail hinzufügen"
280
-
281
- # @ sis
282
- #: ../classes/admin/media.php:204
283
- msgid "Get the PHP for the theme"
284
- msgstr "Hol‘ dir den PHP-Code für dein Theme!"
285
-
286
- # @ sis
287
- #: ../classes/admin/media.php:205
288
- msgid ""
289
- "Copy and paste the code below into your Wordpress theme function file if you "
290
- "wanted to save them and deactivate the plugin."
291
- msgstr ""
292
- "Falls du deine Bildgrößen behalten und das Plugin deaktivieren möchtest, "
293
- "kopiere diesen PHP-Code in die Datei functions.php deines Theme."
294
-
295
- #: ../classes/admin/media.php:221
296
- msgid "Admin option-media template missing"
297
- msgstr ""
298
-
299
- #: ../classes/admin/media.php:425 ../classes/admin/post.php:65
300
- msgid "Trying to cheat ?"
301
- msgstr ""
302
-
303
- # @ sis
304
- #: ../classes/admin/media.php:472
305
- msgid "Regeneration ended"
306
- msgstr ""
307
-
308
- # @ sis
309
- #: ../classes/admin/post.php:216
310
- msgid "Regenerate thumbnails"
311
- msgstr "Artikelbilder neu generieren"
312
-
313
- # @ sis
314
- #: ../classes/admin/post.php:240 ../classes/admin/post.php:243
315
- #: ../templates/options-media.php:138
316
- msgid "Regenerate Thumbnails"
317
- msgstr "Artikelbilder neu generieren"
318
-
319
- # @ sis
320
- #: ../templates/options-media.php:10
321
- msgid "Select which thumbnails you want to rebuild:"
322
- msgstr "Wähle die Artikelbilder aus, die neu generiert werden sollen:"
323
-
324
- # @ sis
325
- #: ../templates/options-media.php:15 ../templates/options-media.php:67
326
- msgid "Size name"
327
- msgstr "Bildgrößenbezeichnung"
328
-
329
- # @ sis
330
- #: ../templates/options-media.php:16 ../templates/options-media.php:68
331
- msgid "Width"
332
- msgstr "Breite"
333
-
334
- # @ sis
335
- #: ../templates/options-media.php:17 ../templates/options-media.php:69
336
- msgid "Height"
337
- msgstr "Höhe"
338
-
339
- # @ sis
340
- #: ../templates/options-media.php:18 ../templates/options-media.php:70
341
- msgid "Crop ?"
342
- msgstr "Beschneiden?"
343
-
344
- # @ sis
345
- #: ../templates/options-media.php:75
346
- msgid "Select which post type source thumbnails you want to rebuild:"
347
- msgstr ""
348
- "Wähle die Inhaltstypen aus, deren Artikelbilder du neu generieren willst:"
349
-
350
- # @ sis
351
- #: ../templates/options-media.php:80 ../templates/options-media.php:107
352
- msgid "Post type"
353
- msgstr "Inhaltstyp"
354
-
355
- # @ sis
356
- #: ../templates/options-media.php:126
357
- msgid "End time calculated :"
358
- msgstr "Berechnetes Ende:"
359
-
360
- #: ../templates/options-media.php:126
361
- msgid "Calculating..."
362
- msgstr ""
363
-
364
- # @ sis
365
- #: ../templates/options-media.php:137
366
- msgid "Last image:"
367
- msgstr "Letztes Bild:"
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-04-20 15:24+0100\n"
6
+ "PO-Revision-Date: 2014-04-20 15:32+0100\n"
7
+ "Last-Translator: Nicolas Juen <nicolas.juen@gmail.com>\n"
8
+ "Language-Team: LANGUAGE <LL@li.org>\n"
9
+ "Language: de_DE\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_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"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "X-Generator: Poedit 1.6.3\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ # @ sis
23
+ #: ../classes/admin/main.php:39
24
+ msgid "Reading attachments..."
25
+ msgstr "Lese Anhänge…"
26
+
27
+ # @ sis
28
+ #: ../classes/admin/main.php:40 ../classes/admin/media.php:154
29
+ msgid "Maximum width"
30
+ msgstr "Maximale Breite"
31
+
32
+ # @ sis
33
+ #: ../classes/admin/main.php:41 ../classes/admin/media.php:158
34
+ msgid "Maximum height"
35
+ msgstr "Maximale Höhe"
36
+
37
+ # @ sis
38
+ #: ../classes/admin/main.php:42
39
+ msgid "Crop"
40
+ msgstr ""
41
+
42
+ # @ sis
43
+ #: ../classes/admin/main.php:43
44
+ msgid "yes"
45
+ msgstr "ja"
46
+
47
+ # @ sis
48
+ #: ../classes/admin/main.php:44
49
+ msgid "no"
50
+ msgstr "nein"
51
+
52
+ # @ sis
53
+ #: ../classes/admin/main.php:45 ../classes/admin/media.php:176
54
+ msgid "Show in post insertion ?"
55
+ msgstr "Beim Einfügen in den Beitrag anzeigen?"
56
+
57
+ # @ sis
58
+ #: ../classes/admin/main.php:46
59
+ msgid " of "
60
+ msgstr "von"
61
+
62
+ # @ sis
63
+ #: ../classes/admin/main.php:47
64
+ msgid " or "
65
+ msgstr "oder"
66
+
67
+ # @ sis
68
+ #: ../classes/admin/main.php:48
69
+ msgid " before the end."
70
+ msgstr "vor dem Ende."
71
+
72
+ # @ sis
73
+ #: ../classes/admin/main.php:49 ../classes/admin/media.php:178
74
+ msgid "Delete"
75
+ msgstr "Löschen"
76
+
77
+ # @ sis
78
+ #: ../classes/admin/main.php:50
79
+ msgid "No media in your site to regenerate !"
80
+ msgstr "Keine Medien neu zu generieren!"
81
+
82
+ # @ sis
83
+ #: ../classes/admin/main.php:51
84
+ msgid "Regenerating "
85
+ msgstr "Neu generieren"
86
+
87
+ # @ sis
88
+ #: ../classes/admin/main.php:52
89
+ msgid "Regenerate "
90
+ msgstr ""
91
+
92
+ # @ sis
93
+ #: ../classes/admin/main.php:53
94
+ msgid "Validate image size name"
95
+ msgstr "Bildgrößenbezeichnung überprüfen"
96
+
97
+ # @ sis
98
+ #: ../classes/admin/main.php:54
99
+ msgid "Done."
100
+ msgstr "Fertig."
101
+
102
+ # @ sis
103
+ #: ../classes/admin/main.php:55
104
+ msgid "Size"
105
+ msgstr "Bildgröße"
106
+
107
+ # @ sis
108
+ #: ../classes/admin/main.php:56
109
+ msgid ""
110
+ "Don't use the basic Wordpress thumbnail size name, use the form above to "
111
+ "edit them"
112
+ msgstr ""
113
+ "Nutze nicht die vorgegebene Thumbnail-Bezeichnung in WordPress! Nutze das "
114
+ "Formular, um diese zu bearbeiten."
115
+
116
+ # @ sis
117
+ #: ../classes/admin/main.php:57
118
+ msgid "This size is already registered, edit it instead of recreating it."
119
+ msgstr ""
120
+ "Die Bildgröße existiert bereits. Du kannst sie bearbeiten, anstatt sie "
121
+ "doppelt anzulegen."
122
+
123
+ # @ sis
124
+ #: ../classes/admin/main.php:58
125
+ msgid "Do you really want to delete these size ?"
126
+ msgstr "Willst du diese Bildgröße/n wirklich löschen?"
127
+
128
+ # @ sis
129
+ #: ../classes/admin/main.php:59 ../classes/admin/media.php:179
130
+ msgid "Update"
131
+ msgstr "Aktualisieren"
132
+
133
+ # @ sis
134
+ #: ../classes/admin/main.php:60
135
+ msgid "Error requesting page"
136
+ msgstr "Fehler beim Abruf der Seite"
137
+
138
+ # @ sis
139
+ #: ../classes/admin/main.php:61
140
+ msgid "images have been regenerated !"
141
+ msgstr "Bilder wurden neu generiert!"
142
+
143
+ # @ sis
144
+ #: ../classes/admin/main.php:62
145
+ msgid "Validate"
146
+ msgstr "Überprüfen"
147
+
148
+ # @ sis
149
+ #: ../classes/admin/main.php:63
150
+ msgid " started at"
151
+ msgstr "begonnen: "
152
+
153
+ # @ sis
154
+ #: ../classes/admin/main.php:64 ../classes/admin/media.php:162
155
+ msgid "Public name"
156
+ msgstr ""
157
+
158
+ # @ sis
159
+ #: ../classes/admin/main.php:65
160
+ msgid " finished at :"
161
+ msgstr "beendet: "
162
+
163
+ # @ sis
164
+ #: ../classes/admin/main.php:66
165
+ msgid ""
166
+ "Error during the php treatment, be sure to not have php errors in your page"
167
+ msgstr ""
168
+ "Fehler während des PHP-Durchlaufs! Stelle sicher, dass sich keine PHP-Fehler "
169
+ "in deiner Seite befinden."
170
+
171
+ # @ sis
172
+ #: ../classes/admin/main.php:67
173
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
174
+ msgstr ""
175
+ "Deine veränderten Bildgrößen wurden noch nicht gespeichert. Trotzdem "
176
+ "fortfahren?"
177
+
178
+ # @ sis
179
+ #: ../classes/admin/main.php:68
180
+ #, php-format
181
+ msgid "This image has been regenerated in %s seconds"
182
+ msgstr "Dieses Bild wurde neu generiert in %s Sekunden."
183
+
184
+ # @ sis
185
+ #: ../classes/admin/main.php:91
186
+ msgid "No id given in POST datas."
187
+ msgstr "Keine ID in den POST-Daten gegeben."
188
+
189
+ # @ sis
190
+ #: ../classes/admin/main.php:104
191
+ #, php-format
192
+ msgid ""
193
+ "This file already exists in this size and have not been regenerated :<br/><a "
194
+ "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
195
+ msgstr ""
196
+
197
+ # @ sis
198
+ #: ../classes/admin/main.php:111
199
+ #, php-format
200
+ msgid ""
201
+ "This file does not exists and have not been regenerated :<br/><a target="
202
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
203
+ msgstr ""
204
+ "Diese Datei existiert nicht und wurde nicht neu generiert:<br/><a target="
205
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
206
+
207
+ #: ../classes/admin/main.php:158
208
+ msgid "Left"
209
+ msgstr ""
210
+
211
+ #: ../classes/admin/main.php:159
212
+ msgid "Center"
213
+ msgstr ""
214
+
215
+ # @ sis
216
+ #: ../classes/admin/main.php:160
217
+ msgid "Right"
218
+ msgstr ""
219
+
220
+ #: ../classes/admin/main.php:164
221
+ msgid "top"
222
+ msgstr ""
223
+
224
+ #: ../classes/admin/main.php:165
225
+ msgid "center"
226
+ msgstr ""
227
+
228
+ #: ../classes/admin/main.php:166
229
+ msgid "bottom"
230
+ msgstr ""
231
+
232
+ # @ sis
233
+ #: ../classes/admin/media.php:66
234
+ msgid "Settings"
235
+ msgstr "Einstellungen"
236
+
237
+ # @ sis
238
+ #: ../classes/admin/media.php:106
239
+ #, php-format
240
+ msgid "%s size"
241
+ msgstr "Bildgröße „%s“"
242
+
243
+ # @ sis
244
+ #: ../classes/admin/media.php:113
245
+ msgid "Add a new size"
246
+ msgstr "Neue Bildgröße hinzufügen"
247
+
248
+ # @ sis
249
+ #: ../classes/admin/media.php:116
250
+ msgid "Get php for theme"
251
+ msgstr "PHP für dein Theme generieren"
252
+
253
+ # @ sis
254
+ #: ../classes/admin/media.php:119
255
+ msgid "Thumbnail regeneration"
256
+ msgstr "Artikelbilder neu generieren"
257
+
258
+ #: ../classes/admin/media.php:155 ../classes/admin/media.php:157
259
+ #: ../classes/admin/media.php:159
260
+ msgid "custom_image_sizes["
261
+ msgstr ""
262
+
263
+ #: ../classes/admin/media.php:166
264
+ msgid "Cropping"
265
+ msgstr ""
266
+
267
+ #: ../classes/admin/media.php:168 ../templates/options-media.php:39
268
+ msgid "No"
269
+ msgstr ""
270
+
271
+ # @ sis
272
+ #: ../classes/admin/media.php:169 ../templates/options-media.php:39
273
+ msgid "Yes"
274
+ msgstr "Ja"
275
+
276
+ # @ sis
277
+ #: ../classes/admin/media.php:192
278
+ msgid "Add a new size of thumbnail"
279
+ msgstr "Neue Bildgröße für Thumbnail hinzufügen"
280
+
281
+ # @ sis
282
+ #: ../classes/admin/media.php:204
283
+ msgid "Get the PHP for the theme"
284
+ msgstr "Hol‘ dir den PHP-Code für dein Theme!"
285
+
286
+ # @ sis
287
+ #: ../classes/admin/media.php:205
288
+ msgid ""
289
+ "Copy and paste the code below into your Wordpress theme function file if you "
290
+ "wanted to save them and deactivate the plugin."
291
+ msgstr ""
292
+ "Falls du deine Bildgrößen behalten und das Plugin deaktivieren möchtest, "
293
+ "kopiere diesen PHP-Code in die Datei functions.php deines Theme."
294
+
295
+ #: ../classes/admin/media.php:221
296
+ msgid "Admin option-media template missing"
297
+ msgstr ""
298
+
299
+ #: ../classes/admin/media.php:425 ../classes/admin/post.php:65
300
+ msgid "Trying to cheat ?"
301
+ msgstr ""
302
+
303
+ # @ sis
304
+ #: ../classes/admin/media.php:472
305
+ msgid "Regeneration ended"
306
+ msgstr ""
307
+
308
+ # @ sis
309
+ #: ../classes/admin/post.php:216
310
+ msgid "Regenerate thumbnails"
311
+ msgstr "Artikelbilder neu generieren"
312
+
313
+ # @ sis
314
+ #: ../classes/admin/post.php:240 ../classes/admin/post.php:243
315
+ #: ../templates/options-media.php:138
316
+ msgid "Regenerate Thumbnails"
317
+ msgstr "Artikelbilder neu generieren"
318
+
319
+ # @ sis
320
+ #: ../templates/options-media.php:10
321
+ msgid "Select which thumbnails you want to rebuild:"
322
+ msgstr "Wähle die Artikelbilder aus, die neu generiert werden sollen:"
323
+
324
+ # @ sis
325
+ #: ../templates/options-media.php:15 ../templates/options-media.php:67
326
+ msgid "Size name"
327
+ msgstr "Bildgrößenbezeichnung"
328
+
329
+ # @ sis
330
+ #: ../templates/options-media.php:16 ../templates/options-media.php:68
331
+ msgid "Width"
332
+ msgstr "Breite"
333
+
334
+ # @ sis
335
+ #: ../templates/options-media.php:17 ../templates/options-media.php:69
336
+ msgid "Height"
337
+ msgstr "Höhe"
338
+
339
+ # @ sis
340
+ #: ../templates/options-media.php:18 ../templates/options-media.php:70
341
+ msgid "Crop ?"
342
+ msgstr "Beschneiden?"
343
+
344
+ # @ sis
345
+ #: ../templates/options-media.php:75
346
+ msgid "Select which post type source thumbnails you want to rebuild:"
347
+ msgstr ""
348
+ "Wähle die Inhaltstypen aus, deren Artikelbilder du neu generieren willst:"
349
+
350
+ # @ sis
351
+ #: ../templates/options-media.php:80 ../templates/options-media.php:107
352
+ msgid "Post type"
353
+ msgstr "Inhaltstyp"
354
+
355
+ # @ sis
356
+ #: ../templates/options-media.php:126
357
+ msgid "End time calculated :"
358
+ msgstr "Berechnetes Ende:"
359
+
360
+ #: ../templates/options-media.php:126
361
+ msgid "Calculating..."
362
+ msgstr ""
363
+
364
+ # @ sis
365
+ #: ../templates/options-media.php:137
366
+ msgid "Last image:"
367
+ msgstr "Letztes Bild:"
languages/simple-image-sizes-fr_FR.po CHANGED
@@ -1,322 +1,322 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Simple image sizes\n"
6
- "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2014-04-20 15:24+0100\n"
8
- "PO-Revision-Date: 2014-04-20 15:31+0100\n"
9
- "Last-Translator: Nicolas Juen <nicolas.juen@gmail.com>\n"
10
- "Language-Team: Beapi <njuen@beapi.fr>\n"
11
- "Language: fr_FR\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__\n"
17
- "X-Poedit-Basepath: ../\n"
18
- "X-Generator: Poedit 1.6.3\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
-
21
- #: classes/admin/main.php:39
22
- msgid "Reading attachments..."
23
- msgstr "Chargement des médias..."
24
-
25
- #: classes/admin/main.php:40 classes/admin/media.php:154
26
- msgid "Maximum width"
27
- msgstr "Largeur maximum"
28
-
29
- #: classes/admin/main.php:41 classes/admin/media.php:158
30
- msgid "Maximum height"
31
- msgstr "Hauteur maximum"
32
-
33
- #: classes/admin/main.php:42
34
- msgid "Crop"
35
- msgstr "Rogner"
36
-
37
- #: classes/admin/main.php:43
38
- msgid "yes"
39
- msgstr "oui"
40
-
41
- #: classes/admin/main.php:44
42
- msgid "no"
43
- msgstr "non"
44
-
45
- #: classes/admin/main.php:45 classes/admin/media.php:176
46
- msgid "Show in post insertion ?"
47
- msgstr "Afficher dans l'insertion ?"
48
-
49
- #: classes/admin/main.php:46
50
- msgid " of "
51
- msgstr " de "
52
-
53
- #: classes/admin/main.php:47
54
- msgid " or "
55
- msgstr " ou "
56
-
57
- #: classes/admin/main.php:48
58
- msgid " before the end."
59
- msgstr " avant la fin."
60
-
61
- #: classes/admin/main.php:49 classes/admin/media.php:178
62
- msgid "Delete"
63
- msgstr "Supprimer"
64
-
65
- #: classes/admin/main.php:50
66
- msgid "No media in your site to regenerate !"
67
- msgstr "Pas de médias à regénérer !"
68
-
69
- #: classes/admin/main.php:51
70
- msgid "Regenerating "
71
- msgstr "Regénération "
72
-
73
- #: classes/admin/main.php:52
74
- msgid "Regenerate "
75
- msgstr "Regénérer "
76
-
77
- #: classes/admin/main.php:53
78
- msgid "Validate image size name"
79
- msgstr "Valider le nom de la taille d'image"
80
-
81
- #: classes/admin/main.php:54
82
- msgid "Done."
83
- msgstr "Fini."
84
-
85
- #: classes/admin/main.php:55
86
- msgid "Size"
87
- msgstr "Taille "
88
-
89
- #: classes/admin/main.php:56
90
- msgid ""
91
- "Don't use the basic Wordpress thumbnail size name, use the form above to "
92
- "edit them"
93
- msgstr ""
94
- "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, "
95
- "éditez leurs valeurs avec le formulaire ci-dessus."
96
-
97
- #: classes/admin/main.php:57
98
- msgid "This size is already registered, edit it instead of recreating it."
99
- msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
100
-
101
- #: classes/admin/main.php:58
102
- msgid "Do you really want to delete these size ?"
103
- msgstr "Voulez-vous réellement supprimer cette taille ?"
104
-
105
- #: classes/admin/main.php:59 classes/admin/media.php:179
106
- msgid "Update"
107
- msgstr "Mettre à jour"
108
-
109
- #: classes/admin/main.php:60
110
- msgid "Error requesting page"
111
- msgstr "Erreur lors de la requête vers la page"
112
-
113
- #: classes/admin/main.php:61
114
- msgid "images have been regenerated !"
115
- msgstr "images ont été regénérées !"
116
-
117
- #: classes/admin/main.php:62
118
- msgid "Validate"
119
- msgstr "Valider"
120
-
121
- #: classes/admin/main.php:63
122
- msgid " started at"
123
- msgstr " commencé à "
124
-
125
- #: classes/admin/main.php:64 classes/admin/media.php:162
126
- msgid "Public name"
127
- msgstr "Nom public"
128
-
129
- #: classes/admin/main.php:65
130
- msgid " finished at :"
131
- msgstr " terminé à :"
132
-
133
- #: classes/admin/main.php:66
134
- msgid ""
135
- "Error during the php treatment, be sure to not have php errors in your page"
136
- msgstr ""
137
- "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans "
138
- "votre page"
139
-
140
- #: classes/admin/main.php:67
141
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
142
- msgstr ""
143
- "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer "
144
- "tout de même ?"
145
-
146
- #: classes/admin/main.php:68
147
- #, php-format
148
- msgid "This image has been regenerated in %s seconds"
149
- msgstr "Cette image a été regénérée en %s secondes"
150
-
151
- #: classes/admin/main.php:91
152
- msgid "No id given in POST datas."
153
- msgstr "Pas d'id donné dans les données du POST."
154
-
155
- #: classes/admin/main.php:104
156
- #, php-format
157
- msgid ""
158
- "This file already exists in this size and have not been regenerated :<br/><a "
159
- "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
160
- msgstr ""
161
- "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
162
- "regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
163
-
164
- #: classes/admin/main.php:111
165
- #, php-format
166
- msgid ""
167
- "This file does not exists and have not been regenerated :<br/><a target="
168
- "\"_blank\" href=\"%1$s\" >%2$s</a>"
169
- msgstr ""
170
- "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
171
- "regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
172
-
173
- #: classes/admin/main.php:158
174
- msgid "Left"
175
- msgstr "Gauche"
176
-
177
- #: classes/admin/main.php:159
178
- msgid "Center"
179
- msgstr "Centre"
180
-
181
- #: classes/admin/main.php:160
182
- msgid "Right"
183
- msgstr "Droite"
184
-
185
- #: classes/admin/main.php:164
186
- msgid "top"
187
- msgstr "haut"
188
-
189
- #: classes/admin/main.php:165
190
- msgid "center"
191
- msgstr "centre"
192
-
193
- #: classes/admin/main.php:166
194
- msgid "bottom"
195
- msgstr "bas"
196
-
197
- #: classes/admin/media.php:66
198
- msgid "Settings"
199
- msgstr "Paramètres"
200
-
201
- #: classes/admin/media.php:106
202
- #, php-format
203
- msgid "%s size"
204
- msgstr "Taille %s"
205
-
206
- #: classes/admin/media.php:113
207
- msgid "Add a new size"
208
- msgstr "Ajouter une nouvelle taille"
209
-
210
- #: classes/admin/media.php:116
211
- msgid "Get php for theme"
212
- msgstr "Récupérer le PHP pour le thème"
213
-
214
- #: classes/admin/media.php:119
215
- msgid "Thumbnail regeneration"
216
- msgstr "Régénération des vignettes"
217
-
218
- #: classes/admin/media.php:166
219
- msgid "Cropping"
220
- msgstr "Rognage"
221
-
222
- #: classes/admin/media.php:205
223
- msgid ""
224
- "Copy and paste the code below into your Wordpress theme function file if you "
225
- "wanted to save them and deactivate the plugin."
226
- msgstr ""
227
- "Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre "
228
- "thème WordPress si vous voulez les conserver et désactiver ce plugin."
229
-
230
- #: classes/admin/media.php:425 classes/admin/post.php:65
231
- msgid "Trying to cheat ?"
232
- msgstr "Cheater ?"
233
-
234
- #: classes/admin/media.php:472
235
- msgid "Regeneration ended"
236
- msgstr "Regénération terminée"
237
-
238
- #: classes/admin/post.php:216
239
- msgid "Regenerate thumbnails"
240
- msgstr "Régénérer les vignettes"
241
-
242
- #: classes/admin/post.php:240 classes/admin/post.php:243
243
- #: templates/options-media.php:138
244
- msgid "Regenerate Thumbnails"
245
- msgstr "Régénérer les vignettes"
246
-
247
- #: templates/options-media.php:10
248
- msgid "Select which thumbnails you want to rebuild:"
249
- msgstr "Sélectionnez les tailles de vignettes à régénérer"
250
-
251
- #: templates/options-media.php:15 templates/options-media.php:67
252
- msgid "Size name"
253
- msgstr "Nom de la taille"
254
-
255
- #: templates/options-media.php:16 templates/options-media.php:68
256
- msgid "Width"
257
- msgstr "Largeur"
258
-
259
- #: templates/options-media.php:17 templates/options-media.php:69
260
- msgid "Height"
261
- msgstr "Hauteur"
262
-
263
- #: templates/options-media.php:18 templates/options-media.php:70
264
- msgid "Crop ?"
265
- msgstr "Rogner ?"
266
-
267
- #: templates/options-media.php:39
268
- msgid "Yes"
269
- msgstr "Oui"
270
-
271
- #: templates/options-media.php:39
272
- msgid "No"
273
- msgstr "Non"
274
-
275
- #: templates/options-media.php:75
276
- msgid "Select which post type source thumbnails you want to rebuild:"
277
- msgstr ""
278
- "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez "
279
- "régénérer : "
280
-
281
- #: templates/options-media.php:80 templates/options-media.php:107
282
- msgid "Post type"
283
- msgstr "Type de contenu"
284
-
285
- #: templates/options-media.php:126
286
- msgid "End time calculated :"
287
- msgstr "Fin du traitement calculé :"
288
-
289
- #: templates/options-media.php:126
290
- msgid "Calculating..."
291
- msgstr "Calcul en cours..."
292
-
293
- #: templates/options-media.php:137
294
- msgid "Last image:"
295
- msgstr "Dernière image :"
296
-
297
- #~ msgid "Legend of the sizes"
298
- #~ msgstr "Légende des tailles"
299
-
300
- #~ msgid ""
301
- #~ "The images created on your theme are <span style=\"color:#F2A13A"
302
- #~ "\">orange</span> and your custom size are <span style=\"color:#89D76A\"> "
303
- #~ "green </span>."
304
- #~ msgstr ""
305
- #~ "Les tailles d'images crées par votre thème sont en <span style=\"color:"
306
- #~ "#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style="
307
- #~ "\"color:#89D76A\"> vert </span>."
308
-
309
- #~ msgid "Size "
310
- #~ msgstr "Taille "
311
-
312
- #~ msgid "Theme size"
313
- #~ msgstr "Taille de thème"
314
-
315
- #~ msgid "Add a new size of thumbnail"
316
- #~ msgstr "Ajouter une nouvelle taille de vignette"
317
-
318
- #~ msgid "Get the PHP for the theme"
319
- #~ msgstr "Récupérer le PHP pour le thème"
320
-
321
- #~ msgid "Resize ?"
322
- #~ msgstr "Regénérer ?"
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Simple image sizes\n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2014-04-20 15:24+0100\n"
8
+ "PO-Revision-Date: 2014-04-20 15:31+0100\n"
9
+ "Last-Translator: Nicolas Juen <nicolas.juen@gmail.com>\n"
10
+ "Language-Team: Beapi <njuen@beapi.fr>\n"
11
+ "Language: fr_FR\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Generator: Poedit 1.6.3\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: classes/admin/main.php:39
22
+ msgid "Reading attachments..."
23
+ msgstr "Chargement des médias..."
24
+
25
+ #: classes/admin/main.php:40 classes/admin/media.php:154
26
+ msgid "Maximum width"
27
+ msgstr "Largeur maximum"
28
+
29
+ #: classes/admin/main.php:41 classes/admin/media.php:158
30
+ msgid "Maximum height"
31
+ msgstr "Hauteur maximum"
32
+
33
+ #: classes/admin/main.php:42
34
+ msgid "Crop"
35
+ msgstr "Rogner"
36
+
37
+ #: classes/admin/main.php:43
38
+ msgid "yes"
39
+ msgstr "oui"
40
+
41
+ #: classes/admin/main.php:44
42
+ msgid "no"
43
+ msgstr "non"
44
+
45
+ #: classes/admin/main.php:45 classes/admin/media.php:176
46
+ msgid "Show in post insertion ?"
47
+ msgstr "Afficher dans l'insertion ?"
48
+
49
+ #: classes/admin/main.php:46
50
+ msgid " of "
51
+ msgstr " de "
52
+
53
+ #: classes/admin/main.php:47
54
+ msgid " or "
55
+ msgstr " ou "
56
+
57
+ #: classes/admin/main.php:48
58
+ msgid " before the end."
59
+ msgstr " avant la fin."
60
+
61
+ #: classes/admin/main.php:49 classes/admin/media.php:178
62
+ msgid "Delete"
63
+ msgstr "Supprimer"
64
+
65
+ #: classes/admin/main.php:50
66
+ msgid "No media in your site to regenerate !"
67
+ msgstr "Pas de médias à regénérer !"
68
+
69
+ #: classes/admin/main.php:51
70
+ msgid "Regenerating "
71
+ msgstr "Regénération "
72
+
73
+ #: classes/admin/main.php:52
74
+ msgid "Regenerate "
75
+ msgstr "Regénérer "
76
+
77
+ #: classes/admin/main.php:53
78
+ msgid "Validate image size name"
79
+ msgstr "Valider le nom de la taille d'image"
80
+
81
+ #: classes/admin/main.php:54
82
+ msgid "Done."
83
+ msgstr "Fini."
84
+
85
+ #: classes/admin/main.php:55
86
+ msgid "Size"
87
+ msgstr "Taille "
88
+
89
+ #: classes/admin/main.php:56
90
+ msgid ""
91
+ "Don't use the basic Wordpress thumbnail size name, use the form above to "
92
+ "edit them"
93
+ msgstr ""
94
+ "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, "
95
+ "éditez leurs valeurs avec le formulaire ci-dessus."
96
+
97
+ #: classes/admin/main.php:57
98
+ msgid "This size is already registered, edit it instead of recreating it."
99
+ msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
100
+
101
+ #: classes/admin/main.php:58
102
+ msgid "Do you really want to delete these size ?"
103
+ msgstr "Voulez-vous réellement supprimer cette taille ?"
104
+
105
+ #: classes/admin/main.php:59 classes/admin/media.php:179
106
+ msgid "Update"
107
+ msgstr "Mettre à jour"
108
+
109
+ #: classes/admin/main.php:60
110
+ msgid "Error requesting page"
111
+ msgstr "Erreur lors de la requête vers la page"
112
+
113
+ #: classes/admin/main.php:61
114
+ msgid "images have been regenerated !"
115
+ msgstr "images ont été regénérées !"
116
+
117
+ #: classes/admin/main.php:62
118
+ msgid "Validate"
119
+ msgstr "Valider"
120
+
121
+ #: classes/admin/main.php:63
122
+ msgid " started at"
123
+ msgstr " commencé à "
124
+
125
+ #: classes/admin/main.php:64 classes/admin/media.php:162
126
+ msgid "Public name"
127
+ msgstr "Nom public"
128
+
129
+ #: classes/admin/main.php:65
130
+ msgid " finished at :"
131
+ msgstr " terminé à :"
132
+
133
+ #: classes/admin/main.php:66
134
+ msgid ""
135
+ "Error during the php treatment, be sure to not have php errors in your page"
136
+ msgstr ""
137
+ "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans "
138
+ "votre page"
139
+
140
+ #: classes/admin/main.php:67
141
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
142
+ msgstr ""
143
+ "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer "
144
+ "tout de même ?"
145
+
146
+ #: classes/admin/main.php:68
147
+ #, php-format
148
+ msgid "This image has been regenerated in %s seconds"
149
+ msgstr "Cette image a été regénérée en %s secondes"
150
+
151
+ #: classes/admin/main.php:91
152
+ msgid "No id given in POST datas."
153
+ msgstr "Pas d'id donné dans les données du POST."
154
+
155
+ #: classes/admin/main.php:104
156
+ #, php-format
157
+ msgid ""
158
+ "This file already exists in this size and have not been regenerated :<br/><a "
159
+ "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
160
+ msgstr ""
161
+ "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
162
+ "regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
163
+
164
+ #: classes/admin/main.php:111
165
+ #, php-format
166
+ msgid ""
167
+ "This file does not exists and have not been regenerated :<br/><a target="
168
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
169
+ msgstr ""
170
+ "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
171
+ "regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
172
+
173
+ #: classes/admin/main.php:158
174
+ msgid "Left"
175
+ msgstr "Gauche"
176
+
177
+ #: classes/admin/main.php:159
178
+ msgid "Center"
179
+ msgstr "Centre"
180
+
181
+ #: classes/admin/main.php:160
182
+ msgid "Right"
183
+ msgstr "Droite"
184
+
185
+ #: classes/admin/main.php:164
186
+ msgid "top"
187
+ msgstr "haut"
188
+
189
+ #: classes/admin/main.php:165
190
+ msgid "center"
191
+ msgstr "centre"
192
+
193
+ #: classes/admin/main.php:166
194
+ msgid "bottom"
195
+ msgstr "bas"
196
+
197
+ #: classes/admin/media.php:66
198
+ msgid "Settings"
199
+ msgstr "Paramètres"
200
+
201
+ #: classes/admin/media.php:106
202
+ #, php-format
203
+ msgid "%s size"
204
+ msgstr "Taille %s"
205
+
206
+ #: classes/admin/media.php:113
207
+ msgid "Add a new size"
208
+ msgstr "Ajouter une nouvelle taille"
209
+
210
+ #: classes/admin/media.php:116
211
+ msgid "Get php for theme"
212
+ msgstr "Récupérer le PHP pour le thème"
213
+
214
+ #: classes/admin/media.php:119
215
+ msgid "Thumbnail regeneration"
216
+ msgstr "Régénération des vignettes"
217
+
218
+ #: classes/admin/media.php:166
219
+ msgid "Cropping"
220
+ msgstr "Rognage"
221
+
222
+ #: classes/admin/media.php:205
223
+ msgid ""
224
+ "Copy and paste the code below into your Wordpress theme function file if you "
225
+ "wanted to save them and deactivate the plugin."
226
+ msgstr ""
227
+ "Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre "
228
+ "thème WordPress si vous voulez les conserver et désactiver ce plugin."
229
+
230
+ #: classes/admin/media.php:425 classes/admin/post.php:65
231
+ msgid "Trying to cheat ?"
232
+ msgstr "Cheater ?"
233
+
234
+ #: classes/admin/media.php:472
235
+ msgid "Regeneration ended"
236
+ msgstr "Regénération terminée"
237
+
238
+ #: classes/admin/post.php:216
239
+ msgid "Regenerate thumbnails"
240
+ msgstr "Régénérer les vignettes"
241
+
242
+ #: classes/admin/post.php:240 classes/admin/post.php:243
243
+ #: templates/options-media.php:138
244
+ msgid "Regenerate Thumbnails"
245
+ msgstr "Régénérer les vignettes"
246
+
247
+ #: templates/options-media.php:10
248
+ msgid "Select which thumbnails you want to rebuild:"
249
+ msgstr "Sélectionnez les tailles de vignettes à régénérer"
250
+
251
+ #: templates/options-media.php:15 templates/options-media.php:67
252
+ msgid "Size name"
253
+ msgstr "Nom de la taille"
254
+
255
+ #: templates/options-media.php:16 templates/options-media.php:68
256
+ msgid "Width"
257
+ msgstr "Largeur"
258
+
259
+ #: templates/options-media.php:17 templates/options-media.php:69
260
+ msgid "Height"
261
+ msgstr "Hauteur"
262
+
263
+ #: templates/options-media.php:18 templates/options-media.php:70
264
+ msgid "Crop ?"
265
+ msgstr "Rogner ?"
266
+
267
+ #: templates/options-media.php:39
268
+ msgid "Yes"
269
+ msgstr "Oui"
270
+
271
+ #: templates/options-media.php:39
272
+ msgid "No"
273
+ msgstr "Non"
274
+
275
+ #: templates/options-media.php:75
276
+ msgid "Select which post type source thumbnails you want to rebuild:"
277
+ msgstr ""
278
+ "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez "
279
+ "régénérer : "
280
+
281
+ #: templates/options-media.php:80 templates/options-media.php:107
282
+ msgid "Post type"
283
+ msgstr "Type de contenu"
284
+
285
+ #: templates/options-media.php:126
286
+ msgid "End time calculated :"
287
+ msgstr "Fin du traitement calculé :"
288
+
289
+ #: templates/options-media.php:126
290
+ msgid "Calculating..."
291
+ msgstr "Calcul en cours..."
292
+
293
+ #: templates/options-media.php:137
294
+ msgid "Last image:"
295
+ msgstr "Dernière image :"
296
+
297
+ #~ msgid "Legend of the sizes"
298
+ #~ msgstr "Légende des tailles"
299
+
300
+ #~ msgid ""
301
+ #~ "The images created on your theme are <span style=\"color:#F2A13A"
302
+ #~ "\">orange</span> and your custom size are <span style=\"color:#89D76A\"> "
303
+ #~ "green </span>."
304
+ #~ msgstr ""
305
+ #~ "Les tailles d'images crées par votre thème sont en <span style=\"color:"
306
+ #~ "#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style="
307
+ #~ "\"color:#89D76A\"> vert </span>."
308
+
309
+ #~ msgid "Size "
310
+ #~ msgstr "Taille "
311
+
312
+ #~ msgid "Theme size"
313
+ #~ msgstr "Taille de thème"
314
+
315
+ #~ msgid "Add a new size of thumbnail"
316
+ #~ msgstr "Ajouter une nouvelle taille de vignette"
317
+
318
+ #~ msgid "Get the PHP for the theme"
319
+ #~ msgstr "Récupérer le PHP pour le thème"
320
+
321
+ #~ msgid "Resize ?"
322
+ #~ msgstr "Regénérer ?"
languages/simple-image-sizes-he_IL.po CHANGED
@@ -1,471 +1,471 @@
1
- # This file was generated by WPML
2
- # WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
3
- # http://wpml.org
4
- msgid ""
5
- msgstr ""
6
- "Content-Type: text/plain; charset=UTF-8\n"
7
- "Content-Transfer-Encoding: 8bit\n"
8
- "Project-Id-Version: simple-image-sizes\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: \n"
11
- "Last-Translator: Ahrale <contact@atar4u.com>\n"
12
- "Language-Team: Ahrale, Atar4U.com <contact@atar4u.com>\n"
13
- "MIME-Version: 1.0\n"
14
- "Language: he_IL\n"
15
- "X-Generator: Poedit 1.7.3\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
-
18
- # 'center' => __( 'center', 'simple-image-sizes' ),
19
- # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
20
- # );
21
- # wpml-name: 71f262d796bed1ab30e8a2d5a8ddee6f
22
- msgid "bottom"
23
- msgstr "למטה"
24
-
25
- # 'center' => __( 'center', 'simple-image-sizes' ),
26
- # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
27
- # );
28
- # wpml-name: adb115059e28d960fa8badfac5516667
29
- msgid "center"
30
- msgstr "מרכז"
31
-
32
- # $y = array(
33
- # 'top' => __( 'top', 'simple-image-sizes' ),
34
- # 'center' => __( 'center', 'simple-image-sizes' ),
35
- # wpml-name: b28354b543375bfa94dabaeda722927f
36
- msgid "top"
37
- msgstr "למעלה"
38
-
39
- # 'center' => __( 'Center', 'simple-image-sizes' ),
40
- # 'right' => __( 'Right', 'simple-image-sizes' ),
41
- # );
42
- # wpml-name: 92b09c7c48c520c3c55e497875da437c
43
- msgid "Right"
44
- msgstr "ימין"
45
-
46
- # 'top' => __( 'top', 'simple-image-sizes' ),
47
- # 'center' => __( 'center', 'simple-image-sizes' ),
48
- # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
49
- # wpml-name: 4f1f6016fc9f3f2353c0cc7c67b292bd
50
- msgid "Center"
51
- msgstr "אמצע"
52
-
53
- # $x = array(
54
- # 'left' => __( 'Left', 'simple-image-sizes' ),
55
- # 'center' => __( 'Center', 'simple-image-sizes' ),
56
- # wpml-name: 945d5e233cf7d6240f6b783b36a374ff
57
- msgid "Left"
58
- msgstr "שמאל"
59
-
60
- # 'time' => timer_stop( false, 4 ),
61
- # 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
62
- # );
63
- # wpml-name: a97ca0c87f209ef404682709c928fb77
64
- msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
65
- msgstr "קובץ זה אינו קיים ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
66
-
67
- # 'time' => timer_stop( false, 4 ),
68
- # 'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
69
- # );
70
- # wpml-name: 5aa7d495ab0ac8335d6c1019be44de71
71
- msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
72
- msgstr "קובץ זה כבר קיים בגודל זה ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
73
-
74
- # 'time' => timer_stop( false, 4 ),
75
- # 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' )
76
- # );
77
- # wpml-name: 31644e7c5c9ebc483f0e6e3497caf08e
78
- msgid "No id given in POST datas."
79
- msgstr "אין מזהה בנתוני הפוסט."
80
-
81
- # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
82
- # 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
83
- # 'crop_positions' => self::get_available_crop(),
84
- # wpml-name: 368cc8aa10b0843efcd7d24789f8f6b7
85
- msgid "This image has been regenerated in %s seconds"
86
- msgstr "תמונה זו נוצרה מחדש ב %s שניות"
87
-
88
- # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
89
- # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
90
- # 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
91
- # wpml-name: 63b1eca818d85423d99421224064c83f
92
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
93
- msgstr "כל המידות ששינית לא נשמרו, להמשיך בכל זאת ?"
94
-
95
- # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
96
- # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
97
- # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
98
- # wpml-name: 2e2e3b980040e2e5ff60122457a2d94e
99
- msgid "Error during the php treatment, be sure to not have php errors in your page"
100
- msgstr "שגיאה במהלך טיפול ה php, וודא שאין שגיאות php בעמוד שלך"
101
-
102
- # 'customName' => __( 'Public name', 'simple-image-sizes' ),
103
- # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
104
- # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
105
- # wpml-name: 250efec0f456647c37b218d66fbf1cd1
106
- msgid " finished at :"
107
- msgstr " הסתיים ב :"
108
-
109
- # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
110
- # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
111
- # 'customName' => __( 'Public name', 'simple-image-sizes' ),
112
- # wpml-name: a8a392d1e0802a5f793863ae847d8d1a
113
- msgid " started at"
114
- msgstr "התחיל ב"
115
-
116
- # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
117
- # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
118
- # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
119
- # wpml-name: ad3d06d03d94223fa652babc913de686
120
- msgid "Validate"
121
- msgstr "אמת"
122
-
123
- # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
124
- # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
125
- # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
126
- # wpml-name: 2be848adf7d74af67397cd8d7afe649f
127
- msgid "images have been regenerated !"
128
- msgstr "תמונות נוצרו מחדש !"
129
-
130
- # 'update' => __( 'Update', 'simple-image-sizes' ),
131
- # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
132
- # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
133
- # wpml-name: fe0bfb1709b1de3ce5b316f877845254
134
- msgid "Error requesting page"
135
- msgstr "שגיאה בבקשת העמוד"
136
-
137
- # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
138
- # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
139
- # 'update' => __( 'Update', 'simple-image-sizes' ),
140
- # wpml-name: aa795e0c2898239890d9a04b3225b71d
141
- msgid "Do you really want to delete these size ?"
142
- msgstr "האם אתה באמת רוצה למחוק את הגודל הזה ?"
143
-
144
- # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
145
- # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
146
- # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
147
- # wpml-name: 580c280158be3a37af3f1a396fa8fa48
148
- msgid "This size is already registered, edit it instead of recreating it."
149
- msgstr "גודל זה כבר רשום, ערוך אותו במקום ליצור אותו מחדש."
150
-
151
- # 'size' => __( 'Size', 'simple-image-sizes' ),
152
- # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
153
- # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
154
- # wpml-name: 09ec5b94f6e7373427b84771c2ec9fda
155
- msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
156
- msgstr "אל תשתמש בשם התמונה הממוזערת של הוורדפרס הבסיסי, השתמש בטופס לעיל כדי לערוך אותם"
157
-
158
- # 'done' => __( 'Done.', 'simple-image-sizes' ),
159
- # 'size' => __( 'Size', 'simple-image-sizes' ),
160
- # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
161
- # wpml-name: 6f6cb72d544962fa333e2e34ce64f719
162
- msgid "Size"
163
- msgstr "גודל"
164
-
165
- # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
166
- # 'done' => __( 'Done.', 'simple-image-sizes' ),
167
- # 'size' => __( 'Size', 'simple-image-sizes' ),
168
- # wpml-name: f5940523060652e3a7d9c269ce48de50
169
- msgid "Done."
170
- msgstr "בוצע."
171
-
172
- # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
173
- # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
174
- # 'done' => __( 'Done.', 'simple-image-sizes' ),
175
- # wpml-name: 7a50a2d7840041d6668f889ea35fa548
176
- msgid "Validate image size name"
177
- msgstr "אמת את שם הגודל"
178
-
179
- # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
180
- # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
181
- # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
182
- # wpml-name: 69314e19325b39027d107d0c79a9897d
183
- msgid "Regenerate "
184
- msgstr "צור מחדש "
185
-
186
- # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
187
- # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
188
- # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
189
- # wpml-name: 2d2ed670c4cb53daf32909b501fa4620
190
- msgid "Regenerating "
191
- msgstr "יוצר מחדש"
192
-
193
- # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
194
- # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
195
- # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
196
- # wpml-name: 37b1d0785260f44322eb6aa55ef3b1ad
197
- msgid "No media in your site to regenerate !"
198
- msgstr "אין מדיה באתר שלך ליצור מחדש !"
199
-
200
- # 'or' => __( ' or ', 'simple-image-sizes' ),
201
- # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
202
- # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
203
- # wpml-name: b08355a64e809c27c91ee20706e66d1b
204
- msgid " before the end."
205
- msgstr "לפני הסוף."
206
-
207
- # 'of' => __( ' of ', 'simple-image-sizes' ),
208
- # 'or' => __( ' or ', 'simple-image-sizes' ),
209
- # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
210
- # wpml-name: 8e0c4e984dbb4b30a86c232b15df8490
211
- msgid " or "
212
- msgstr "או "
213
-
214
- # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
215
- # 'of' => __( ' of ', 'simple-image-sizes' ),
216
- # 'or' => __( ' or ', 'simple-image-sizes' ),
217
- # wpml-name: 7e7e076a81fa5dc64f44b8ff14199cbf
218
- msgid " of "
219
- msgstr " של "
220
-
221
- # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
222
- # <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
223
- # <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
224
- # wpml-name: 7fa3b767c460b54a2be4d49030b349c7
225
- msgid "no"
226
- msgstr "לא"
227
-
228
- # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
229
- # <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
230
- # <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
231
- # wpml-name: a6105c0a611b41b08f1209506350279e
232
- msgid "yes"
233
- msgstr "כן"
234
-
235
- # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
236
- # 'crop' => __( 'Crop', 'simple-image-sizes' ),
237
- # 'tr' => __( 'yes', 'simple-image-sizes' ),
238
- # wpml-name: d388632d05e8826abe4b95de0b110529
239
- msgid "Crop"
240
- msgstr "חתוך"
241
-
242
- # 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
243
- # 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
244
- # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
245
- # wpml-name: 6a98035cbc4c133b74c77491ce876940
246
- msgid "Reading attachments..."
247
- msgstr "קורא קבצים מצורפים..."
248
-
249
- # 'html' => '
250
- # <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
251
- # <span class="spinner"></span>
252
- # wpml-name: 258606ef5a3ed5cd7e39da08435adec0
253
- msgid "Regenerate thumbnails"
254
- msgstr "יוצר מחדש תמונות ממוזערות"
255
-
256
- # } else {
257
- # esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
258
- # }
259
- # wpml-name: f528f9b0d97ba7592b85a85f0c9f9c13
260
- msgid "Admin option-media template missing"
261
- msgstr "חסרה תבנית ניהול אפשרות-מדיה"
262
-
263
- # public static function getPhpButton() { ?>
264
- # <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
265
- # <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
266
- # wpml-name: bb3db310d06bffcbddaf06323583e91d
267
- msgid "Get the PHP for the theme"
268
- msgstr "קבל את ה PHP עבור ערכת הנושא"
269
-
270
- # public static function addSizeButton() { ?>
271
- # <input type="button" class="button-secondary action" id="add_size" value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes'); ?>" />
272
- # <?php
273
- # wpml-name: 786741aec3b7c066357245ef98dc9fde
274
- msgid "Add a new size of thumbnail"
275
- msgstr "הוסף גודל חדש של תמונה ממוזערת"
276
-
277
- # if( !wp_verify_nonce( $nonce , 'regen' ) ) {
278
- # SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
279
- # }
280
- # wpml-name: b57077974e73b05d05c5ab21a7bb35fe
281
- msgid "Trying to cheat ?"
282
- msgstr "מנסה לרמות ?"
283
-
284
- # <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
285
- # <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
286
- # <code></code>
287
- # wpml-name: 265103d3ca486243e0f00a62d6dfd2b7
288
- msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
289
- msgstr "העתק והדבק את הקוד שלהלן אל קובץ function.php בערכת הנושא של הוורדפרס שלך אם אתה רוצה לשמור אותם ולכבות את התוסף."
290
-
291
- # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
292
- # 'update' => __( 'Update', 'simple-image-sizes' ),
293
- # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
294
- # wpml-name: 06933067aafd48425d67bcb01bba5cb6
295
- msgid "Update"
296
- msgstr "עדכן"
297
-
298
- # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
299
- # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
300
- # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
301
- # wpml-name: f2a6c498fb90ee345d997f888fce3b18
302
- msgid "Delete"
303
- msgstr "מחיקה"
304
-
305
- # 'fl' => __( 'no', 'simple-image-sizes' ),
306
- # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
307
- # 'of' => __( ' of ', 'simple-image-sizes' ),
308
- # wpml-name: b223790b250471a6cae35deb5a4b0aa4
309
- msgid "Show in post insertion ?"
310
- msgstr "להציג בהוספה לפוסט ?"
311
-
312
- # <span class="size_options">
313
- # <label class="c" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes'); ?></label>
314
- # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
315
- # wpml-name: 57bb299f73bf5946a8d4790cc4bbd8fb
316
- msgid "Cropping"
317
- msgstr "חיתוך"
318
-
319
- # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
320
- # 'customName' => __( 'Public name', 'simple-image-sizes' ),
321
- # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
322
- # wpml-name: d274013ea65428454962a59b7b373a41
323
- msgid "Public name"
324
- msgstr "שם ציבורי"
325
-
326
- # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
327
- # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
328
- # 'crop' => __( 'Crop', 'simple-image-sizes' ),
329
- # wpml-name: d3c7d075cfb70ed08d062facb1a056e8
330
- msgid "Maximum height"
331
- msgstr "גובה מירבי"
332
-
333
- # 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
334
- # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
335
- # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
336
- # wpml-name: 614a998c745fcc3009bf6c6daf18562e
337
- msgid "Maximum width"
338
- msgstr "רוחב מירבי"
339
-
340
- # return array(
341
- # 'message' => __( 'Regeneration ended', 'simple-image-sizes')
342
- # );
343
- # wpml-name: cd4e39700ffd7ae49e430859c97834c2
344
- msgid "Regeneration ended"
345
- msgstr "היצירה מחדש הסתיימה"
346
-
347
- # // Add section for the thumbnail regeneration
348
- # add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array( __CLASS__, 'thumbnailRegenerate' ), 'media' );
349
- # }
350
- # wpml-name: 99e4f0028f10ce4b38eb35c5488c1bba
351
- msgid "Thumbnail regeneration"
352
- msgstr "יצירה מחדש של תמונה ממוזערת"
353
-
354
- # // Add php button
355
- # add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array( __CLASS__, 'getPhpButton' ), 'media' );
356
- #
357
- # wpml-name: fea30a43d377bbead8aace51d915477a
358
- msgid "Get php for theme"
359
- msgstr "קבל php עבור ערכת הנושא"
360
-
361
- # // Add the button
362
- # add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array( __CLASS__, 'addSizeButton' ), 'media' );
363
- #
364
- # wpml-name: a2da7c2e28e5e69b7daaa13377ee29e4
365
- msgid "Add a new size"
366
- msgstr "הוספת גודל חדש"
367
-
368
- # // Add the setting field for this size
369
- # add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array( __CLASS__, 'image_sizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
370
- # }
371
- # wpml-name: be74017300bae51721e39b611652ee22
372
- msgid "%s size"
373
- msgstr "גודל %s"
374
-
375
- #
376
- # $settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'simple-image-sizes' ).' </a>';
377
- # array_unshift( $links, $settings_link );
378
- # wpml-name: f4f70727dc34561dfde1a3c529b6205c
379
- msgid "Settings"
380
- msgstr "הגדרות"
381
-
382
- # 'html' => '
383
- # <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
384
- # <span class="spinner"></span>
385
- # wpml-name: 6f8330b0bc479531022cb9002cffde14
386
- msgid "Regenerate Thumbnails"
387
- msgstr "צור מחדש תמונות ממוזערות"
388
-
389
- # </div>
390
- # <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes'); ?></h4><img class="thumb-img" /></div>
391
- # <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ) ?>" />
392
- # wpml-name: c9d4436607c99b571f4d84ff0e1a8fb5
393
- msgid "Last image:"
394
- msgstr "תמונה אחרונה:"
395
-
396
- # <span class="ui-icon ui-icon-info"></span>
397
- # <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
398
- # </p>
399
- # wpml-name: 0582cd2fd62743a89db5f715fd51e532
400
- msgid "Calculating..."
401
- msgstr "מחשב..."
402
-
403
- # <span class="ui-icon ui-icon-info"></span>
404
- # <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
405
- # </p>
406
- # wpml-name: fe5a9d159a95ad346f9443464115edfc
407
- msgid "End time calculated :"
408
- msgstr "חישוב זמן סיום :"
409
-
410
- # <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
411
- # <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes'); ?></th>
412
- # </tr>
413
- # wpml-name: 363c969ebde35c09236f5355c6dff165
414
- msgid "Post type"
415
- msgstr "סוג מאמר"
416
-
417
- #
418
- # <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes'); ?></h4>
419
- # <table cellspacing="0" class="widefat page fixed sis">
420
- # wpml-name: 4f02f535b1a39a2fc34c244b5fe5c828
421
- msgid "Select which post type source thumbnails you want to rebuild:"
422
- msgstr "בחר אילו תמונות ממוזערות של אילו סוגי פוסט אתה רוצה לבנות מחדש:"
423
-
424
- # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
425
- # <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
426
- # </tr>
427
- # wpml-name: 8ae8aaf1c06d7eeee38c66ba6f6c4f00
428
- msgid "Crop ?"
429
- msgstr "לחתוך ?"
430
-
431
- # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
432
- # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
433
- # <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
434
- # wpml-name: eec6c4bdbd339edf8cbea68becb85244
435
- msgid "Height"
436
- msgstr "גובה"
437
-
438
- # <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
439
- # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
440
- # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
441
- # wpml-name: 32954654ac8fe66a1d09be19001de2d4
442
- msgid "Width"
443
- msgstr "רוחב"
444
-
445
- # <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
446
- # <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
447
- # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
448
- # wpml-name: 3e6a625faef0050601371de85af0630d
449
- msgid "Size name"
450
- msgstr "שם המידה"
451
-
452
- # <div class="wrapper" style="">
453
- # <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes'); ?> </h4>
454
- # <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
455
- # wpml-name: d3108e30b8046e29dd3baa9b3c455d35
456
- msgid "Select which thumbnails you want to rebuild:"
457
- msgstr "בחר אילו תמונות ממוזערות אתה רוצה לבנות מחדש:"
458
-
459
- # 'tr' => __( 'yes', 'simple-image-sizes' ),
460
- # 'fl' => __( 'no', 'simple-image-sizes' ),
461
- # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
462
- # wpml-name: bafd7322c6e97d25b6299b5d6fe8920b
463
- msgid "No"
464
- msgstr "לא"
465
-
466
- # 'crop' => __( 'Crop', 'simple-image-sizes' ),
467
- # 'tr' => __( 'yes', 'simple-image-sizes' ),
468
- # 'fl' => __( 'no', 'simple-image-sizes' ),
469
- # wpml-name: 93cba07454f06a4a960172bbd6e2a435
470
- msgid "Yes"
471
- msgstr "כן"
1
+ # This file was generated by WPML
2
+ # WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
3
+ # http://wpml.org
4
+ msgid ""
5
+ msgstr ""
6
+ "Content-Type: text/plain; charset=UTF-8\n"
7
+ "Content-Transfer-Encoding: 8bit\n"
8
+ "Project-Id-Version: simple-image-sizes\n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: Ahrale <contact@atar4u.com>\n"
12
+ "Language-Team: Ahrale, Atar4U.com <contact@atar4u.com>\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Language: he_IL\n"
15
+ "X-Generator: Poedit 1.7.3\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+
18
+ # 'center' => __( 'center', 'simple-image-sizes' ),
19
+ # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
20
+ # );
21
+ # wpml-name: 71f262d796bed1ab30e8a2d5a8ddee6f
22
+ msgid "bottom"
23
+ msgstr "למטה"
24
+
25
+ # 'center' => __( 'center', 'simple-image-sizes' ),
26
+ # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
27
+ # );
28
+ # wpml-name: adb115059e28d960fa8badfac5516667
29
+ msgid "center"
30
+ msgstr "מרכז"
31
+
32
+ # $y = array(
33
+ # 'top' => __( 'top', 'simple-image-sizes' ),
34
+ # 'center' => __( 'center', 'simple-image-sizes' ),
35
+ # wpml-name: b28354b543375bfa94dabaeda722927f
36
+ msgid "top"
37
+ msgstr "למעלה"
38
+
39
+ # 'center' => __( 'Center', 'simple-image-sizes' ),
40
+ # 'right' => __( 'Right', 'simple-image-sizes' ),
41
+ # );
42
+ # wpml-name: 92b09c7c48c520c3c55e497875da437c
43
+ msgid "Right"
44
+ msgstr "ימין"
45
+
46
+ # 'top' => __( 'top', 'simple-image-sizes' ),
47
+ # 'center' => __( 'center', 'simple-image-sizes' ),
48
+ # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
49
+ # wpml-name: 4f1f6016fc9f3f2353c0cc7c67b292bd
50
+ msgid "Center"
51
+ msgstr "אמצע"
52
+
53
+ # $x = array(
54
+ # 'left' => __( 'Left', 'simple-image-sizes' ),
55
+ # 'center' => __( 'Center', 'simple-image-sizes' ),
56
+ # wpml-name: 945d5e233cf7d6240f6b783b36a374ff
57
+ msgid "Left"
58
+ msgstr "שמאל"
59
+
60
+ # 'time' => timer_stop( false, 4 ),
61
+ # 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
62
+ # );
63
+ # wpml-name: a97ca0c87f209ef404682709c928fb77
64
+ msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
65
+ msgstr "קובץ זה אינו קיים ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
66
+
67
+ # 'time' => timer_stop( false, 4 ),
68
+ # 'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
69
+ # );
70
+ # wpml-name: 5aa7d495ab0ac8335d6c1019be44de71
71
+ msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
72
+ msgstr "קובץ זה כבר קיים בגודל זה ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
73
+
74
+ # 'time' => timer_stop( false, 4 ),
75
+ # 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' )
76
+ # );
77
+ # wpml-name: 31644e7c5c9ebc483f0e6e3497caf08e
78
+ msgid "No id given in POST datas."
79
+ msgstr "אין מזהה בנתוני הפוסט."
80
+
81
+ # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
82
+ # 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
83
+ # 'crop_positions' => self::get_available_crop(),
84
+ # wpml-name: 368cc8aa10b0843efcd7d24789f8f6b7
85
+ msgid "This image has been regenerated in %s seconds"
86
+ msgstr "תמונה זו נוצרה מחדש ב %s שניות"
87
+
88
+ # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
89
+ # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
90
+ # 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
91
+ # wpml-name: 63b1eca818d85423d99421224064c83f
92
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
93
+ msgstr "כל המידות ששינית לא נשמרו, להמשיך בכל זאת ?"
94
+
95
+ # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
96
+ # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
97
+ # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
98
+ # wpml-name: 2e2e3b980040e2e5ff60122457a2d94e
99
+ msgid "Error during the php treatment, be sure to not have php errors in your page"
100
+ msgstr "שגיאה במהלך טיפול ה php, וודא שאין שגיאות php בעמוד שלך"
101
+
102
+ # 'customName' => __( 'Public name', 'simple-image-sizes' ),
103
+ # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
104
+ # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
105
+ # wpml-name: 250efec0f456647c37b218d66fbf1cd1
106
+ msgid " finished at :"
107
+ msgstr " הסתיים ב :"
108
+
109
+ # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
110
+ # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
111
+ # 'customName' => __( 'Public name', 'simple-image-sizes' ),
112
+ # wpml-name: a8a392d1e0802a5f793863ae847d8d1a
113
+ msgid " started at"
114
+ msgstr "התחיל ב"
115
+
116
+ # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
117
+ # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
118
+ # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
119
+ # wpml-name: ad3d06d03d94223fa652babc913de686
120
+ msgid "Validate"
121
+ msgstr "אמת"
122
+
123
+ # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
124
+ # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
125
+ # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
126
+ # wpml-name: 2be848adf7d74af67397cd8d7afe649f
127
+ msgid "images have been regenerated !"
128
+ msgstr "תמונות נוצרו מחדש !"
129
+
130
+ # 'update' => __( 'Update', 'simple-image-sizes' ),
131
+ # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
132
+ # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
133
+ # wpml-name: fe0bfb1709b1de3ce5b316f877845254
134
+ msgid "Error requesting page"
135
+ msgstr "שגיאה בבקשת העמוד"
136
+
137
+ # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
138
+ # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
139
+ # 'update' => __( 'Update', 'simple-image-sizes' ),
140
+ # wpml-name: aa795e0c2898239890d9a04b3225b71d
141
+ msgid "Do you really want to delete these size ?"
142
+ msgstr "האם אתה באמת רוצה למחוק את הגודל הזה ?"
143
+
144
+ # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
145
+ # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
146
+ # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
147
+ # wpml-name: 580c280158be3a37af3f1a396fa8fa48
148
+ msgid "This size is already registered, edit it instead of recreating it."
149
+ msgstr "גודל זה כבר רשום, ערוך אותו במקום ליצור אותו מחדש."
150
+
151
+ # 'size' => __( 'Size', 'simple-image-sizes' ),
152
+ # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
153
+ # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
154
+ # wpml-name: 09ec5b94f6e7373427b84771c2ec9fda
155
+ msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
156
+ msgstr "אל תשתמש בשם התמונה הממוזערת של הוורדפרס הבסיסי, השתמש בטופס לעיל כדי לערוך אותם"
157
+
158
+ # 'done' => __( 'Done.', 'simple-image-sizes' ),
159
+ # 'size' => __( 'Size', 'simple-image-sizes' ),
160
+ # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
161
+ # wpml-name: 6f6cb72d544962fa333e2e34ce64f719
162
+ msgid "Size"
163
+ msgstr "גודל"
164
+
165
+ # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
166
+ # 'done' => __( 'Done.', 'simple-image-sizes' ),
167
+ # 'size' => __( 'Size', 'simple-image-sizes' ),
168
+ # wpml-name: f5940523060652e3a7d9c269ce48de50
169
+ msgid "Done."
170
+ msgstr "בוצע."
171
+
172
+ # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
173
+ # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
174
+ # 'done' => __( 'Done.', 'simple-image-sizes' ),
175
+ # wpml-name: 7a50a2d7840041d6668f889ea35fa548
176
+ msgid "Validate image size name"
177
+ msgstr "אמת את שם הגודל"
178
+
179
+ # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
180
+ # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
181
+ # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
182
+ # wpml-name: 69314e19325b39027d107d0c79a9897d
183
+ msgid "Regenerate "
184
+ msgstr "צור מחדש "
185
+
186
+ # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
187
+ # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
188
+ # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
189
+ # wpml-name: 2d2ed670c4cb53daf32909b501fa4620
190
+ msgid "Regenerating "
191
+ msgstr "יוצר מחדש"
192
+
193
+ # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
194
+ # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
195
+ # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
196
+ # wpml-name: 37b1d0785260f44322eb6aa55ef3b1ad
197
+ msgid "No media in your site to regenerate !"
198
+ msgstr "אין מדיה באתר שלך ליצור מחדש !"
199
+
200
+ # 'or' => __( ' or ', 'simple-image-sizes' ),
201
+ # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
202
+ # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
203
+ # wpml-name: b08355a64e809c27c91ee20706e66d1b
204
+ msgid " before the end."
205
+ msgstr "לפני הסוף."
206
+
207
+ # 'of' => __( ' of ', 'simple-image-sizes' ),
208
+ # 'or' => __( ' or ', 'simple-image-sizes' ),
209
+ # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
210
+ # wpml-name: 8e0c4e984dbb4b30a86c232b15df8490
211
+ msgid " or "
212
+ msgstr "או "
213
+
214
+ # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
215
+ # 'of' => __( ' of ', 'simple-image-sizes' ),
216
+ # 'or' => __( ' or ', 'simple-image-sizes' ),
217
+ # wpml-name: 7e7e076a81fa5dc64f44b8ff14199cbf
218
+ msgid " of "
219
+ msgstr " של "
220
+
221
+ # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
222
+ # <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
223
+ # <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
224
+ # wpml-name: 7fa3b767c460b54a2be4d49030b349c7
225
+ msgid "no"
226
+ msgstr "לא"
227
+
228
+ # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
229
+ # <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
230
+ # <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
231
+ # wpml-name: a6105c0a611b41b08f1209506350279e
232
+ msgid "yes"
233
+ msgstr "כן"
234
+
235
+ # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
236
+ # 'crop' => __( 'Crop', 'simple-image-sizes' ),
237
+ # 'tr' => __( 'yes', 'simple-image-sizes' ),
238
+ # wpml-name: d388632d05e8826abe4b95de0b110529
239
+ msgid "Crop"
240
+ msgstr "חתוך"
241
+
242
+ # 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
243
+ # 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
244
+ # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
245
+ # wpml-name: 6a98035cbc4c133b74c77491ce876940
246
+ msgid "Reading attachments..."
247
+ msgstr "קורא קבצים מצורפים..."
248
+
249
+ # 'html' => '
250
+ # <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
251
+ # <span class="spinner"></span>
252
+ # wpml-name: 258606ef5a3ed5cd7e39da08435adec0
253
+ msgid "Regenerate thumbnails"
254
+ msgstr "יוצר מחדש תמונות ממוזערות"
255
+
256
+ # } else {
257
+ # esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
258
+ # }
259
+ # wpml-name: f528f9b0d97ba7592b85a85f0c9f9c13
260
+ msgid "Admin option-media template missing"
261
+ msgstr "חסרה תבנית ניהול אפשרות-מדיה"
262
+
263
+ # public static function getPhpButton() { ?>
264
+ # <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
265
+ # <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
266
+ # wpml-name: bb3db310d06bffcbddaf06323583e91d
267
+ msgid "Get the PHP for the theme"
268
+ msgstr "קבל את ה PHP עבור ערכת הנושא"
269
+
270
+ # public static function addSizeButton() { ?>
271
+ # <input type="button" class="button-secondary action" id="add_size" value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes'); ?>" />
272
+ # <?php
273
+ # wpml-name: 786741aec3b7c066357245ef98dc9fde
274
+ msgid "Add a new size of thumbnail"
275
+ msgstr "הוסף גודל חדש של תמונה ממוזערת"
276
+
277
+ # if( !wp_verify_nonce( $nonce , 'regen' ) ) {
278
+ # SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
279
+ # }
280
+ # wpml-name: b57077974e73b05d05c5ab21a7bb35fe
281
+ msgid "Trying to cheat ?"
282
+ msgstr "מנסה לרמות ?"
283
+
284
+ # <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
285
+ # <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
286
+ # <code></code>
287
+ # wpml-name: 265103d3ca486243e0f00a62d6dfd2b7
288
+ msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
289
+ msgstr "העתק והדבק את הקוד שלהלן אל קובץ function.php בערכת הנושא של הוורדפרס שלך אם אתה רוצה לשמור אותם ולכבות את התוסף."
290
+
291
+ # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
292
+ # 'update' => __( 'Update', 'simple-image-sizes' ),
293
+ # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
294
+ # wpml-name: 06933067aafd48425d67bcb01bba5cb6
295
+ msgid "Update"
296
+ msgstr "עדכן"
297
+
298
+ # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
299
+ # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
300
+ # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
301
+ # wpml-name: f2a6c498fb90ee345d997f888fce3b18
302
+ msgid "Delete"
303
+ msgstr "מחיקה"
304
+
305
+ # 'fl' => __( 'no', 'simple-image-sizes' ),
306
+ # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
307
+ # 'of' => __( ' of ', 'simple-image-sizes' ),
308
+ # wpml-name: b223790b250471a6cae35deb5a4b0aa4
309
+ msgid "Show in post insertion ?"
310
+ msgstr "להציג בהוספה לפוסט ?"
311
+
312
+ # <span class="size_options">
313
+ # <label class="c" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes'); ?></label>
314
+ # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
315
+ # wpml-name: 57bb299f73bf5946a8d4790cc4bbd8fb
316
+ msgid "Cropping"
317
+ msgstr "חיתוך"
318
+
319
+ # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
320
+ # 'customName' => __( 'Public name', 'simple-image-sizes' ),
321
+ # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
322
+ # wpml-name: d274013ea65428454962a59b7b373a41
323
+ msgid "Public name"
324
+ msgstr "שם ציבורי"
325
+
326
+ # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
327
+ # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
328
+ # 'crop' => __( 'Crop', 'simple-image-sizes' ),
329
+ # wpml-name: d3c7d075cfb70ed08d062facb1a056e8
330
+ msgid "Maximum height"
331
+ msgstr "גובה מירבי"
332
+
333
+ # 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
334
+ # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
335
+ # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
336
+ # wpml-name: 614a998c745fcc3009bf6c6daf18562e
337
+ msgid "Maximum width"
338
+ msgstr "רוחב מירבי"
339
+
340
+ # return array(
341
+ # 'message' => __( 'Regeneration ended', 'simple-image-sizes')
342
+ # );
343
+ # wpml-name: cd4e39700ffd7ae49e430859c97834c2
344
+ msgid "Regeneration ended"
345
+ msgstr "היצירה מחדש הסתיימה"
346
+
347
+ # // Add section for the thumbnail regeneration
348
+ # add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array( __CLASS__, 'thumbnailRegenerate' ), 'media' );
349
+ # }
350
+ # wpml-name: 99e4f0028f10ce4b38eb35c5488c1bba
351
+ msgid "Thumbnail regeneration"
352
+ msgstr "יצירה מחדש של תמונה ממוזערת"
353
+
354
+ # // Add php button
355
+ # add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array( __CLASS__, 'getPhpButton' ), 'media' );
356
+ #
357
+ # wpml-name: fea30a43d377bbead8aace51d915477a
358
+ msgid "Get php for theme"
359
+ msgstr "קבל php עבור ערכת הנושא"
360
+
361
+ # // Add the button
362
+ # add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array( __CLASS__, 'addSizeButton' ), 'media' );
363
+ #
364
+ # wpml-name: a2da7c2e28e5e69b7daaa13377ee29e4
365
+ msgid "Add a new size"
366
+ msgstr "הוספת גודל חדש"
367
+
368
+ # // Add the setting field for this size
369
+ # add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array( __CLASS__, 'image_sizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
370
+ # }
371
+ # wpml-name: be74017300bae51721e39b611652ee22
372
+ msgid "%s size"
373
+ msgstr "גודל %s"
374
+
375
+ #
376
+ # $settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'simple-image-sizes' ).' </a>';
377
+ # array_unshift( $links, $settings_link );
378
+ # wpml-name: f4f70727dc34561dfde1a3c529b6205c
379
+ msgid "Settings"
380
+ msgstr "הגדרות"
381
+
382
+ # 'html' => '
383
+ # <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
384
+ # <span class="spinner"></span>
385
+ # wpml-name: 6f8330b0bc479531022cb9002cffde14
386
+ msgid "Regenerate Thumbnails"
387
+ msgstr "צור מחדש תמונות ממוזערות"
388
+
389
+ # </div>
390
+ # <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes'); ?></h4><img class="thumb-img" /></div>
391
+ # <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ) ?>" />
392
+ # wpml-name: c9d4436607c99b571f4d84ff0e1a8fb5
393
+ msgid "Last image:"
394
+ msgstr "תמונה אחרונה:"
395
+
396
+ # <span class="ui-icon ui-icon-info"></span>
397
+ # <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
398
+ # </p>
399
+ # wpml-name: 0582cd2fd62743a89db5f715fd51e532
400
+ msgid "Calculating..."
401
+ msgstr "מחשב..."
402
+
403
+ # <span class="ui-icon ui-icon-info"></span>
404
+ # <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
405
+ # </p>
406
+ # wpml-name: fe5a9d159a95ad346f9443464115edfc
407
+ msgid "End time calculated :"
408
+ msgstr "חישוב זמן סיום :"
409
+
410
+ # <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
411
+ # <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes'); ?></th>
412
+ # </tr>
413
+ # wpml-name: 363c969ebde35c09236f5355c6dff165
414
+ msgid "Post type"
415
+ msgstr "סוג מאמר"
416
+
417
+ #
418
+ # <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes'); ?></h4>
419
+ # <table cellspacing="0" class="widefat page fixed sis">
420
+ # wpml-name: 4f02f535b1a39a2fc34c244b5fe5c828
421
+ msgid "Select which post type source thumbnails you want to rebuild:"
422
+ msgstr "בחר אילו תמונות ממוזערות של אילו סוגי פוסט אתה רוצה לבנות מחדש:"
423
+
424
+ # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
425
+ # <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
426
+ # </tr>
427
+ # wpml-name: 8ae8aaf1c06d7eeee38c66ba6f6c4f00
428
+ msgid "Crop ?"
429
+ msgstr "לחתוך ?"
430
+
431
+ # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
432
+ # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
433
+ # <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
434
+ # wpml-name: eec6c4bdbd339edf8cbea68becb85244
435
+ msgid "Height"
436
+ msgstr "גובה"
437
+
438
+ # <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
439
+ # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
440
+ # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
441
+ # wpml-name: 32954654ac8fe66a1d09be19001de2d4
442
+ msgid "Width"
443
+ msgstr "רוחב"
444
+
445
+ # <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
446
+ # <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
447
+ # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
448
+ # wpml-name: 3e6a625faef0050601371de85af0630d
449
+ msgid "Size name"
450
+ msgstr "שם המידה"
451
+
452
+ # <div class="wrapper" style="">
453
+ # <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes'); ?> </h4>
454
+ # <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
455
+ # wpml-name: d3108e30b8046e29dd3baa9b3c455d35
456
+ msgid "Select which thumbnails you want to rebuild:"
457
+ msgstr "בחר אילו תמונות ממוזערות אתה רוצה לבנות מחדש:"
458
+
459
+ # 'tr' => __( 'yes', 'simple-image-sizes' ),
460
+ # 'fl' => __( 'no', 'simple-image-sizes' ),
461
+ # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
462
+ # wpml-name: bafd7322c6e97d25b6299b5d6fe8920b
463
+ msgid "No"
464
+ msgstr "לא"
465
+
466
+ # 'crop' => __( 'Crop', 'simple-image-sizes' ),
467
+ # 'tr' => __( 'yes', 'simple-image-sizes' ),
468
+ # 'fl' => __( 'no', 'simple-image-sizes' ),
469
+ # wpml-name: 93cba07454f06a4a960172bbd6e2a435
470
+ msgid "Yes"
471
+ msgstr "כן"
languages/simple-image-sizes.pot CHANGED
@@ -1,296 +1,296 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: \n"
6
- "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2014-04-20 15:24+0100\n"
8
- "PO-Revision-Date: 2014-04-20 15:24+0100\n"
9
- "Last-Translator: \n"
10
- "Language-Team: LANGUAGE <LL@li.org>\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-Basepath: .\n"
15
- "X-Poedit-KeywordsList: esc_attr_e;esc_html_e;esc_attr__;esc_html__;_e;__\n"
16
- "X-Generator: Poedit 1.6.3\n"
17
- "X-Poedit-SearchPath-0: ..\n"
18
-
19
- #: ../classes/admin/main.php:39
20
- msgid "Reading attachments..."
21
- msgstr ""
22
-
23
- #: ../classes/admin/main.php:40 ../classes/admin/media.php:154
24
- msgid "Maximum width"
25
- msgstr ""
26
-
27
- #: ../classes/admin/main.php:41 ../classes/admin/media.php:158
28
- msgid "Maximum height"
29
- msgstr ""
30
-
31
- #: ../classes/admin/main.php:42
32
- msgid "Crop"
33
- msgstr ""
34
-
35
- #: ../classes/admin/main.php:43
36
- msgid "yes"
37
- msgstr ""
38
-
39
- #: ../classes/admin/main.php:44
40
- msgid "no"
41
- msgstr ""
42
-
43
- #: ../classes/admin/main.php:45 ../classes/admin/media.php:176
44
- msgid "Show in post insertion ?"
45
- msgstr ""
46
-
47
- #: ../classes/admin/main.php:46
48
- msgid " of "
49
- msgstr ""
50
-
51
- #: ../classes/admin/main.php:47
52
- msgid " or "
53
- msgstr ""
54
-
55
- #: ../classes/admin/main.php:48
56
- msgid " before the end."
57
- msgstr ""
58
-
59
- #: ../classes/admin/main.php:49 ../classes/admin/media.php:178
60
- msgid "Delete"
61
- msgstr ""
62
-
63
- #: ../classes/admin/main.php:50
64
- msgid "No media in your site to regenerate !"
65
- msgstr ""
66
-
67
- #: ../classes/admin/main.php:51
68
- msgid "Regenerating "
69
- msgstr ""
70
-
71
- #: ../classes/admin/main.php:52
72
- msgid "Regenerate "
73
- msgstr ""
74
-
75
- #: ../classes/admin/main.php:53
76
- msgid "Validate image size name"
77
- msgstr ""
78
-
79
- #: ../classes/admin/main.php:54
80
- msgid "Done."
81
- msgstr ""
82
-
83
- #: ../classes/admin/main.php:55
84
- msgid "Size"
85
- msgstr ""
86
-
87
- #: ../classes/admin/main.php:56
88
- msgid ""
89
- "Don't use the basic Wordpress thumbnail size name, use the form above to "
90
- "edit them"
91
- msgstr ""
92
-
93
- #: ../classes/admin/main.php:57
94
- msgid "This size is already registered, edit it instead of recreating it."
95
- msgstr ""
96
-
97
- #: ../classes/admin/main.php:58
98
- msgid "Do you really want to delete these size ?"
99
- msgstr ""
100
-
101
- #: ../classes/admin/main.php:59 ../classes/admin/media.php:179
102
- msgid "Update"
103
- msgstr ""
104
-
105
- #: ../classes/admin/main.php:60
106
- msgid "Error requesting page"
107
- msgstr ""
108
-
109
- #: ../classes/admin/main.php:61
110
- msgid "images have been regenerated !"
111
- msgstr ""
112
-
113
- #: ../classes/admin/main.php:62
114
- msgid "Validate"
115
- msgstr ""
116
-
117
- #: ../classes/admin/main.php:63
118
- msgid " started at"
119
- msgstr ""
120
-
121
- #: ../classes/admin/main.php:64 ../classes/admin/media.php:162
122
- msgid "Public name"
123
- msgstr ""
124
-
125
- #: ../classes/admin/main.php:65
126
- msgid " finished at :"
127
- msgstr ""
128
-
129
- #: ../classes/admin/main.php:66
130
- msgid ""
131
- "Error during the php treatment, be sure to not have php errors in your page"
132
- msgstr ""
133
-
134
- #: ../classes/admin/main.php:67
135
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
136
- msgstr ""
137
-
138
- #: ../classes/admin/main.php:68
139
- #, php-format
140
- msgid "This image has been regenerated in %s seconds"
141
- msgstr ""
142
-
143
- #: ../classes/admin/main.php:91
144
- msgid "No id given in POST datas."
145
- msgstr ""
146
-
147
- #: ../classes/admin/main.php:104
148
- #, php-format
149
- msgid ""
150
- "This file already exists in this size and have not been regenerated :<br/><a "
151
- "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
152
- msgstr ""
153
-
154
- #: ../classes/admin/main.php:111
155
- #, php-format
156
- msgid ""
157
- "This file does not exists and have not been regenerated :<br/><a target="
158
- "\"_blank\" href=\"%1$s\" >%2$s</a>"
159
- msgstr ""
160
-
161
- #: ../classes/admin/main.php:158
162
- msgid "Left"
163
- msgstr ""
164
-
165
- #: ../classes/admin/main.php:159
166
- msgid "Center"
167
- msgstr ""
168
-
169
- #: ../classes/admin/main.php:160
170
- msgid "Right"
171
- msgstr ""
172
-
173
- #: ../classes/admin/main.php:164
174
- msgid "top"
175
- msgstr ""
176
-
177
- #: ../classes/admin/main.php:165
178
- msgid "center"
179
- msgstr ""
180
-
181
- #: ../classes/admin/main.php:166
182
- msgid "bottom"
183
- msgstr ""
184
-
185
- #: ../classes/admin/media.php:66
186
- msgid "Settings"
187
- msgstr ""
188
-
189
- #: ../classes/admin/media.php:106
190
- #, php-format
191
- msgid "%s size"
192
- msgstr ""
193
-
194
- #: ../classes/admin/media.php:113
195
- msgid "Add a new size"
196
- msgstr ""
197
-
198
- #: ../classes/admin/media.php:116
199
- msgid "Get php for theme"
200
- msgstr ""
201
-
202
- #: ../classes/admin/media.php:119
203
- msgid "Thumbnail regeneration"
204
- msgstr ""
205
-
206
- #: ../classes/admin/media.php:155 ../classes/admin/media.php:157
207
- #: ../classes/admin/media.php:159
208
- msgid "custom_image_sizes["
209
- msgstr ""
210
-
211
- #: ../classes/admin/media.php:166
212
- msgid "Cropping"
213
- msgstr ""
214
-
215
- #: ../classes/admin/media.php:168 ../templates/options-media.php:39
216
- msgid "No"
217
- msgstr ""
218
-
219
- #: ../classes/admin/media.php:169 ../templates/options-media.php:39
220
- msgid "Yes"
221
- msgstr ""
222
-
223
- #: ../classes/admin/media.php:192
224
- msgid "Add a new size of thumbnail"
225
- msgstr ""
226
-
227
- #: ../classes/admin/media.php:204
228
- msgid "Get the PHP for the theme"
229
- msgstr ""
230
-
231
- #: ../classes/admin/media.php:205
232
- msgid ""
233
- "Copy and paste the code below into your Wordpress theme function file if you "
234
- "wanted to save them and deactivate the plugin."
235
- msgstr ""
236
-
237
- #: ../classes/admin/media.php:221
238
- msgid "Admin option-media template missing"
239
- msgstr ""
240
-
241
- #: ../classes/admin/media.php:425 ../classes/admin/post.php:65
242
- msgid "Trying to cheat ?"
243
- msgstr ""
244
-
245
- #: ../classes/admin/media.php:472
246
- msgid "Regeneration ended"
247
- msgstr ""
248
-
249
- #: ../classes/admin/post.php:216
250
- msgid "Regenerate thumbnails"
251
- msgstr ""
252
-
253
- #: ../classes/admin/post.php:240 ../classes/admin/post.php:243
254
- #: ../templates/options-media.php:138
255
- msgid "Regenerate Thumbnails"
256
- msgstr ""
257
-
258
- #: ../templates/options-media.php:10
259
- msgid "Select which thumbnails you want to rebuild:"
260
- msgstr ""
261
-
262
- #: ../templates/options-media.php:15 ../templates/options-media.php:67
263
- msgid "Size name"
264
- msgstr ""
265
-
266
- #: ../templates/options-media.php:16 ../templates/options-media.php:68
267
- msgid "Width"
268
- msgstr ""
269
-
270
- #: ../templates/options-media.php:17 ../templates/options-media.php:69
271
- msgid "Height"
272
- msgstr ""
273
-
274
- #: ../templates/options-media.php:18 ../templates/options-media.php:70
275
- msgid "Crop ?"
276
- msgstr ""
277
-
278
- #: ../templates/options-media.php:75
279
- msgid "Select which post type source thumbnails you want to rebuild:"
280
- msgstr ""
281
-
282
- #: ../templates/options-media.php:80 ../templates/options-media.php:107
283
- msgid "Post type"
284
- msgstr ""
285
-
286
- #: ../templates/options-media.php:126
287
- msgid "End time calculated :"
288
- msgstr ""
289
-
290
- #: ../templates/options-media.php:126
291
- msgid "Calculating..."
292
- msgstr ""
293
-
294
- #: ../templates/options-media.php:137
295
- msgid "Last image:"
296
- msgstr ""
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2014-04-20 15:24+0100\n"
8
+ "PO-Revision-Date: 2014-04-20 15:24+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: LANGUAGE <LL@li.org>\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-KeywordsList: esc_attr_e;esc_html_e;esc_attr__;esc_html__;_e;__\n"
16
+ "X-Generator: Poedit 1.6.3\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #: ../classes/admin/main.php:39
20
+ msgid "Reading attachments..."
21
+ msgstr ""
22
+
23
+ #: ../classes/admin/main.php:40 ../classes/admin/media.php:154
24
+ msgid "Maximum width"
25
+ msgstr ""
26
+
27
+ #: ../classes/admin/main.php:41 ../classes/admin/media.php:158
28
+ msgid "Maximum height"
29
+ msgstr ""
30
+
31
+ #: ../classes/admin/main.php:42
32
+ msgid "Crop"
33
+ msgstr ""
34
+
35
+ #: ../classes/admin/main.php:43
36
+ msgid "yes"
37
+ msgstr ""
38
+
39
+ #: ../classes/admin/main.php:44
40
+ msgid "no"
41
+ msgstr ""
42
+
43
+ #: ../classes/admin/main.php:45 ../classes/admin/media.php:176
44
+ msgid "Show in post insertion ?"
45
+ msgstr ""
46
+
47
+ #: ../classes/admin/main.php:46
48
+ msgid " of "
49
+ msgstr ""
50
+
51
+ #: ../classes/admin/main.php:47
52
+ msgid " or "
53
+ msgstr ""
54
+
55
+ #: ../classes/admin/main.php:48
56
+ msgid " before the end."
57
+ msgstr ""
58
+
59
+ #: ../classes/admin/main.php:49 ../classes/admin/media.php:178
60
+ msgid "Delete"
61
+ msgstr ""
62
+
63
+ #: ../classes/admin/main.php:50
64
+ msgid "No media in your site to regenerate !"
65
+ msgstr ""
66
+
67
+ #: ../classes/admin/main.php:51
68
+ msgid "Regenerating "
69
+ msgstr ""
70
+
71
+ #: ../classes/admin/main.php:52
72
+ msgid "Regenerate "
73
+ msgstr ""
74
+
75
+ #: ../classes/admin/main.php:53
76
+ msgid "Validate image size name"
77
+ msgstr ""
78
+
79
+ #: ../classes/admin/main.php:54
80
+ msgid "Done."
81
+ msgstr ""
82
+
83
+ #: ../classes/admin/main.php:55
84
+ msgid "Size"
85
+ msgstr ""
86
+
87
+ #: ../classes/admin/main.php:56
88
+ msgid ""
89
+ "Don't use the basic Wordpress thumbnail size name, use the form above to "
90
+ "edit them"
91
+ msgstr ""
92
+
93
+ #: ../classes/admin/main.php:57
94
+ msgid "This size is already registered, edit it instead of recreating it."
95
+ msgstr ""
96
+
97
+ #: ../classes/admin/main.php:58
98
+ msgid "Do you really want to delete these size ?"
99
+ msgstr ""
100
+
101
+ #: ../classes/admin/main.php:59 ../classes/admin/media.php:179
102
+ msgid "Update"
103
+ msgstr ""
104
+
105
+ #: ../classes/admin/main.php:60
106
+ msgid "Error requesting page"
107
+ msgstr ""
108
+
109
+ #: ../classes/admin/main.php:61
110
+ msgid "images have been regenerated !"
111
+ msgstr ""
112
+
113
+ #: ../classes/admin/main.php:62
114
+ msgid "Validate"
115
+ msgstr ""
116
+
117
+ #: ../classes/admin/main.php:63
118
+ msgid " started at"
119
+ msgstr ""
120
+
121
+ #: ../classes/admin/main.php:64 ../classes/admin/media.php:162
122
+ msgid "Public name"
123
+ msgstr ""
124
+
125
+ #: ../classes/admin/main.php:65
126
+ msgid " finished at :"
127
+ msgstr ""
128
+
129
+ #: ../classes/admin/main.php:66
130
+ msgid ""
131
+ "Error during the php treatment, be sure to not have php errors in your page"
132
+ msgstr ""
133
+
134
+ #: ../classes/admin/main.php:67
135
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
136
+ msgstr ""
137
+
138
+ #: ../classes/admin/main.php:68
139
+ #, php-format
140
+ msgid "This image has been regenerated in %s seconds"
141
+ msgstr ""
142
+
143
+ #: ../classes/admin/main.php:91
144
+ msgid "No id given in POST datas."
145
+ msgstr ""
146
+
147
+ #: ../classes/admin/main.php:104
148
+ #, php-format
149
+ msgid ""
150
+ "This file already exists in this size and have not been regenerated :<br/><a "
151
+ "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
152
+ msgstr ""
153
+
154
+ #: ../classes/admin/main.php:111
155
+ #, php-format
156
+ msgid ""
157
+ "This file does not exists and have not been regenerated :<br/><a target="
158
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
159
+ msgstr ""
160
+
161
+ #: ../classes/admin/main.php:158
162
+ msgid "Left"
163
+ msgstr ""
164
+
165
+ #: ../classes/admin/main.php:159
166
+ msgid "Center"
167
+ msgstr ""
168
+
169
+ #: ../classes/admin/main.php:160
170
+ msgid "Right"
171
+ msgstr ""
172
+
173
+ #: ../classes/admin/main.php:164
174
+ msgid "top"
175
+ msgstr ""
176
+
177
+ #: ../classes/admin/main.php:165
178
+ msgid "center"
179
+ msgstr ""
180
+
181
+ #: ../classes/admin/main.php:166
182
+ msgid "bottom"
183
+ msgstr ""
184
+
185
+ #: ../classes/admin/media.php:66
186
+ msgid "Settings"
187
+ msgstr ""
188
+
189
+ #: ../classes/admin/media.php:106
190
+ #, php-format
191
+ msgid "%s size"
192
+ msgstr ""
193
+
194
+ #: ../classes/admin/media.php:113
195
+ msgid "Add a new size"
196
+ msgstr ""
197
+
198
+ #: ../classes/admin/media.php:116
199
+ msgid "Get php for theme"
200
+ msgstr ""
201
+
202
+ #: ../classes/admin/media.php:119
203
+ msgid "Thumbnail regeneration"
204
+ msgstr ""
205
+
206
+ #: ../classes/admin/media.php:155 ../classes/admin/media.php:157
207
+ #: ../classes/admin/media.php:159
208
+ msgid "custom_image_sizes["
209
+ msgstr ""
210
+
211
+ #: ../classes/admin/media.php:166
212
+ msgid "Cropping"
213
+ msgstr ""
214
+
215
+ #: ../classes/admin/media.php:168 ../templates/options-media.php:39
216
+ msgid "No"
217
+ msgstr ""
218
+
219
+ #: ../classes/admin/media.php:169 ../templates/options-media.php:39
220
+ msgid "Yes"
221
+ msgstr ""
222
+
223
+ #: ../classes/admin/media.php:192
224
+ msgid "Add a new size of thumbnail"
225
+ msgstr ""
226
+
227
+ #: ../classes/admin/media.php:204
228
+ msgid "Get the PHP for the theme"
229
+ msgstr ""
230
+
231
+ #: ../classes/admin/media.php:205
232
+ msgid ""
233
+ "Copy and paste the code below into your Wordpress theme function file if you "
234
+ "wanted to save them and deactivate the plugin."
235
+ msgstr ""
236
+
237
+ #: ../classes/admin/media.php:221
238
+ msgid "Admin option-media template missing"
239
+ msgstr ""
240
+
241
+ #: ../classes/admin/media.php:425 ../classes/admin/post.php:65
242
+ msgid "Trying to cheat ?"
243
+ msgstr ""
244
+
245
+ #: ../classes/admin/media.php:472
246
+ msgid "Regeneration ended"
247
+ msgstr ""
248
+
249
+ #: ../classes/admin/post.php:216
250
+ msgid "Regenerate thumbnails"
251
+ msgstr ""
252
+
253
+ #: ../classes/admin/post.php:240 ../classes/admin/post.php:243
254
+ #: ../templates/options-media.php:138
255
+ msgid "Regenerate Thumbnails"
256
+ msgstr ""
257
+
258
+ #: ../templates/options-media.php:10
259
+ msgid "Select which thumbnails you want to rebuild:"
260
+ msgstr ""
261
+
262
+ #: ../templates/options-media.php:15 ../templates/options-media.php:67
263
+ msgid "Size name"
264
+ msgstr ""
265
+
266
+ #: ../templates/options-media.php:16 ../templates/options-media.php:68
267
+ msgid "Width"
268
+ msgstr ""
269
+
270
+ #: ../templates/options-media.php:17 ../templates/options-media.php:69
271
+ msgid "Height"
272
+ msgstr ""
273
+
274
+ #: ../templates/options-media.php:18 ../templates/options-media.php:70
275
+ msgid "Crop ?"
276
+ msgstr ""
277
+
278
+ #: ../templates/options-media.php:75
279
+ msgid "Select which post type source thumbnails you want to rebuild:"
280
+ msgstr ""
281
+
282
+ #: ../templates/options-media.php:80 ../templates/options-media.php:107
283
+ msgid "Post type"
284
+ msgstr ""
285
+
286
+ #: ../templates/options-media.php:126
287
+ msgid "End time calculated :"
288
+ msgstr ""
289
+
290
+ #: ../templates/options-media.php:126
291
+ msgid "Calculating..."
292
+ msgstr ""
293
+
294
+ #: ../templates/options-media.php:137
295
+ msgid "Last image:"
296
+ msgstr ""
package.json CHANGED
@@ -1,17 +1,22 @@
1
- {
2
- "name": "simple-image-sizes",
3
- "version": "3.0.7",
4
- "description": "Simple image sizes for WordPress",
5
- "author": "Nicolas Juen",
6
- "devDependencies": {
7
- "gulp": "*",
8
- "gulp-concat-sourcemap": "*",
9
- "gulp-cssmin": "*",
10
- "gulp-jshint": "*",
11
- "gulp-load-plugins": "*",
12
- "gulp-rename": "*",
13
- "gulp-uglify": "*",
14
- "gulp-watch": "*",
15
- "matchdep": "*"
16
- }
 
 
 
 
 
17
  }
1
+ {
2
+ "name": "simple-image-sizes",
3
+ "version": "3.0.8",
4
+ "description": "Simple image sizes for WordPress",
5
+ "author": "Nicolas Juen",
6
+ "license": "GPL-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Rahe/simple-image-sizes"
10
+ },
11
+ "devDependencies": {
12
+ "gulp": "*",
13
+ "gulp-concat-sourcemap": "*",
14
+ "gulp-cssmin": "*",
15
+ "gulp-jshint": "*",
16
+ "gulp-load-plugins": "*",
17
+ "gulp-rename": "*",
18
+ "gulp-uglify": "*",
19
+ "gulp-watch": "*",
20
+ "matchdep": "*"
21
+ }
22
  }
readme.txt CHANGED
@@ -1,187 +1,192 @@
1
- === Simple Image Sizes ===
2
- Contributors: Rahe
3
- Donate link: http://www.beapi.fr/donate/
4
- Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
5
- Requires at least: 3.5
6
- Tested up to: 4.2.1
7
- Stable tag: 3.0.7
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- == Description ==
12
-
13
- This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
14
- You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
15
- You can now get all the code to copy and paste to your function theme file.
16
- Now you can use the generated sizes directly into your posts and insert images at the right size !
17
- Now you choose if you want display the size in the post insert image.
18
- Now you can regenerate the images one by one in the 'Medias' general pane.
19
- Now you can regenerate the images by bulk action in the 'Medias' general pane.
20
- Now you can regenerate the image sizes on single attachment edit page.
21
-
22
- I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
23
- I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
24
-
25
- Contribute on https://github.com/Rahe/Simple-image-sizes
26
-
27
- == Installation ==
28
- **PHP5 Required.**
29
-
30
- 1. Download, unzip and upload to your WordPress plugins directory
31
- 2. Activate the plugin within you WordPress Administration Backend
32
- 3. Go to Settings > Medias
33
- 4. Configure your new image sizes and regenerate the thumbnails !
34
-
35
- == Frequently Asked Questions ==
36
-
37
- = Where can I add image sizes ? =
38
- Go to Settings -> Media then you can add a image size. You have to add a unique custom name without any spaces or special chars.
39
- The best is to use something like my-custom-size.
40
- Then you have several fields for configuring the image size, the widht, the height, cropping.
41
- And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
42
-
43
-
44
- == Screenshots ==
45
-
46
- 1. Settings page
47
- 2. Get PHP for the theme
48
- 3. Choose the sizes to regenerate and regenerate them
49
-
50
- == Changelog ==
51
- * 3.0.7
52
- * Fix bug on single image regeneration upload page
53
- * Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
54
- * 3.0.6
55
- * Fix bug for the image adding
56
- * 3.0.5
57
- * Fix bug on condition
58
- * 3.0.4
59
- * Fix global add_image_size
60
- * 3.0.3
61
- * Add Hebrew translations thanks to Atar4U
62
- * 3.0.2
63
- * Fix version check for the image crop positions
64
- * 3.0.1
65
- * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
66
- * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
67
- * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
68
- * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
69
- * 3.0
70
- * Revamping all the code, change classes and structure
71
- * Use grunt for compiling files
72
- * Handle the 3.9 new cropping position
73
- * Remove aristo css
74
- * Use UI from WordPress
75
- * 2.4.3
76
- * Remove some php notices
77
- * Remove notice when wrong image size
78
- * 2.4.2
79
- * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
80
- * 2.4.1
81
- * Remove function not working on admin file
82
- * 2.4
83
- * Made for 3.5 and up
84
- * Refactoring PHP/Javascript code
85
- * Javascript improvements
86
- * Remove useless UI
87
- * UI improvements
88
- * Global PHP performance improvements
89
- * 2.3.1
90
- * Add Ajax bulk actions on medias list
91
- * Add ajax thumbnail rebuild on single media
92
- * 2.3
93
- * Add the custom size name in the attachment insertion
94
- * Exclude post_type wich do not support the post-thumbnail feature
95
- * 2.2.5
96
- * Debug the regeneration buggy !
97
- * Complete the french translation
98
- * Security update for single regeneration, include the nonce this time :)
99
- * 2.2.4
100
- * Add security nonces for every actions
101
- * Put the messages at the begining of the log
102
- * Add a select all checkbox Thank to cocola
103
- * Add the german translation thanks to glueckpress
104
- * Remove notice tnahks to christianwach
105
- * Remove useless and buggy for my scripting pointers
106
- * 2.2.3
107
- * Do not force network usage
108
- * 2.2.2
109
- * Debug js for the buttons
110
- * Remove console.log calls
111
- * 2.2.1
112
- * Use buttonset for the checkboxes
113
- * Add Pointer for WordPress 3.3
114
- * Fix translation in French
115
- * Some medias queries for small windows ( change size of buttons and alignment )
116
- * 2.2
117
- * Add new version of css aristo
118
- * Add some icons
119
- * Display button for saving changes only when changes detected
120
- * Display message when a size is modified but not saved and wanted to regenerate
121
- * Debug functionnality when regenerating only some sizes, metas not crushed
122
- * Add solo regenerating
123
- * Remove displaying for theme/not theme sizes
124
- * Use WordPress class for small inputs
125
- * 2.1
126
- * Add javascript timer
127
- * Improve javascript and more IE friendly
128
- * You can now choose if you want to display the image sizes in image insertion or not
129
- * Handle errors and messages
130
- * Remove some css useless rules
131
- * Fix bad translation for french
132
- * Remove accents in image sizes
133
- * Do not update size properties if there is an ajax query for an another size name
134
- * 2.0.3
135
- * Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
136
- * 2.0.2
137
- * Remove debug on php for javascript
138
- * Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
139
- * 2.0.1
140
- * Resolve javascript issue when clicking on delete button
141
- * Resolve issue of never unchecking crop button
142
- * 2.0
143
- * Code refactoring
144
- * Update translations
145
- * Ajaxification of the process
146
- * Deleting by Ajax
147
- * Updating by Ajax
148
- * Adding by Ajax
149
- * Change UI
150
- * Change theme
151
- * Handle ajax errors
152
- * Handle not modified sizes, cropped
153
- * Handle same names
154
- * Sanitize the names
155
- * Customize jQuery ui
156
- * Customize jQuery ui theme
157
- * HTML5 Elements
158
- * CSS3 Animations
159
- * 1.0.6
160
- * Minify javascript names
161
- * Change progressbar style
162
- * Add animations on progressbar
163
- * 1.0.5
164
- * Only add css and js script in the media page to avoid any javascript error in other pages
165
- * Rectify css
166
- * Add function to get the code for the function.php file of the theme
167
- * Don't redefine the Wordpress basic size names
168
- * 1.0.4
169
- * Fix the add_image_size issue ( height and width reversed )
170
- * 1.0.3
171
- * Fix the plugin language
172
- * Add some translations
173
- * Externalise some css
174
- * Add sizes in the image adding to an article
175
- * Add setting link in the plugins list
176
- * Use admin_url instead of home_url
177
- * Add legend for colors
178
- * Some code refactoring
179
- * 1.0.2
180
- * Fix the plugin license
181
- * 1.0.1
182
- * Add POT file
183
- * Add french translation
184
- * 1.0
185
- * First release
186
- * Thumbnail regenerate
 
 
 
 
 
187
  * Image size generation
1
+ === Simple Image Sizes ===
2
+ Contributors: Rahe
3
+ Donate link: http://www.beapi.fr/donate/
4
+ Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
5
+ Requires at least: 3.5
6
+ Tested up to: 4.2.2
7
+ Stable tag: 3.0.8
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ == Description ==
12
+
13
+ This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
14
+ You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
15
+ You can now get all the code to copy and paste to your function theme file.
16
+ Now you can use the generated sizes directly into your posts and insert images at the right size !
17
+ Now you choose if you want display the size in the post insert image.
18
+ Now you can regenerate the images one by one in the 'Medias' general pane.
19
+ Now you can regenerate the images by bulk action in the 'Medias' general pane.
20
+ Now you can regenerate the image sizes on single attachment edit page.
21
+
22
+ I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
23
+ I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
24
+
25
+ Contribute on https://github.com/Rahe/Simple-image-sizes
26
+
27
+ == Installation ==
28
+ **PHP5 Required.**
29
+
30
+ 1. Download, unzip and upload to your WordPress plugins directory
31
+ 2. Activate the plugin within you WordPress Administration Backend
32
+ 3. Go to Settings > Medias
33
+ 4. Configure your new image sizes and regenerate the thumbnails !
34
+
35
+ == Frequently Asked Questions ==
36
+
37
+ = Where can I add image sizes ? =
38
+ Go to Settings -> Media then you can add a image size. You have to add a unique custom name without any spaces or special chars.
39
+ The best is to use something like my-custom-size.
40
+ Then you have several fields for configuring the image size, the widht, the height, cropping.
41
+ And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
42
+
43
+
44
+ == Screenshots ==
45
+
46
+ 1. Settings page
47
+ 2. Get PHP for the theme
48
+ 3. Choose the sizes to regenerate and regenerate them
49
+
50
+ == Changelog ==
51
+ * 3.0.8
52
+ * Fix potential bug on error ajax
53
+ * Stop using init hook and use after_setup_theme for image size registering
54
+ * Update underscore cdn version for WP install without it
55
+ * Remove useless timer_start
56
+ * 3.0.7
57
+ * Fix bug on single image regeneration upload page
58
+ * Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
59
+ * 3.0.6
60
+ * Fix bug for the image adding
61
+ * 3.0.5
62
+ * Fix bug on condition
63
+ * 3.0.4
64
+ * Fix global add_image_size
65
+ * 3.0.3
66
+ * Add Hebrew translations thanks to Atar4U
67
+ * 3.0.2
68
+ * Fix version check for the image crop positions
69
+ * 3.0.1
70
+ * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
71
+ * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
72
+ * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
73
+ * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
74
+ * 3.0
75
+ * Revamping all the code, change classes and structure
76
+ * Use grunt for compiling files
77
+ * Handle the 3.9 new cropping position
78
+ * Remove aristo css
79
+ * Use UI from WordPress
80
+ * 2.4.3
81
+ * Remove some php notices
82
+ * Remove notice when wrong image size
83
+ * 2.4.2
84
+ * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
85
+ * 2.4.1
86
+ * Remove function not working on admin file
87
+ * 2.4
88
+ * Made for 3.5 and up
89
+ * Refactoring PHP/Javascript code
90
+ * Javascript improvements
91
+ * Remove useless UI
92
+ * UI improvements
93
+ * Global PHP performance improvements
94
+ * 2.3.1
95
+ * Add Ajax bulk actions on medias list
96
+ * Add ajax thumbnail rebuild on single media
97
+ * 2.3
98
+ * Add the custom size name in the attachment insertion
99
+ * Exclude post_type wich do not support the post-thumbnail feature
100
+ * 2.2.5
101
+ * Debug the regeneration buggy !
102
+ * Complete the french translation
103
+ * Security update for single regeneration, include the nonce this time :)
104
+ * 2.2.4
105
+ * Add security nonces for every actions
106
+ * Put the messages at the begining of the log
107
+ * Add a select all checkbox Thank to cocola
108
+ * Add the german translation thanks to glueckpress
109
+ * Remove notice tnahks to christianwach
110
+ * Remove useless and buggy for my scripting pointers
111
+ * 2.2.3
112
+ * Do not force network usage
113
+ * 2.2.2
114
+ * Debug js for the buttons
115
+ * Remove console.log calls
116
+ * 2.2.1
117
+ * Use buttonset for the checkboxes
118
+ * Add Pointer for WordPress 3.3
119
+ * Fix translation in French
120
+ * Some medias queries for small windows ( change size of buttons and alignment )
121
+ * 2.2
122
+ * Add new version of css aristo
123
+ * Add some icons
124
+ * Display button for saving changes only when changes detected
125
+ * Display message when a size is modified but not saved and wanted to regenerate
126
+ * Debug functionnality when regenerating only some sizes, metas not crushed
127
+ * Add solo regenerating
128
+ * Remove displaying for theme/not theme sizes
129
+ * Use WordPress class for small inputs
130
+ * 2.1
131
+ * Add javascript timer
132
+ * Improve javascript and more IE friendly
133
+ * You can now choose if you want to display the image sizes in image insertion or not
134
+ * Handle errors and messages
135
+ * Remove some css useless rules
136
+ * Fix bad translation for french
137
+ * Remove accents in image sizes
138
+ * Do not update size properties if there is an ajax query for an another size name
139
+ * 2.0.3
140
+ * Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
141
+ * 2.0.2
142
+ * Remove debug on php for javascript
143
+ * Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
144
+ * 2.0.1
145
+ * Resolve javascript issue when clicking on delete button
146
+ * Resolve issue of never unchecking crop button
147
+ * 2.0
148
+ * Code refactoring
149
+ * Update translations
150
+ * Ajaxification of the process
151
+ * Deleting by Ajax
152
+ * Updating by Ajax
153
+ * Adding by Ajax
154
+ * Change UI
155
+ * Change theme
156
+ * Handle ajax errors
157
+ * Handle not modified sizes, cropped
158
+ * Handle same names
159
+ * Sanitize the names
160
+ * Customize jQuery ui
161
+ * Customize jQuery ui theme
162
+ * HTML5 Elements
163
+ * CSS3 Animations
164
+ * 1.0.6
165
+ * Minify javascript names
166
+ * Change progressbar style
167
+ * Add animations on progressbar
168
+ * 1.0.5
169
+ * Only add css and js script in the media page to avoid any javascript error in other pages
170
+ * Rectify css
171
+ * Add function to get the code for the function.php file of the theme
172
+ * Don't redefine the Wordpress basic size names
173
+ * 1.0.4
174
+ * Fix the add_image_size issue ( height and width reversed )
175
+ * 1.0.3
176
+ * Fix the plugin language
177
+ * Add some translations
178
+ * Externalise some css
179
+ * Add sizes in the image adding to an article
180
+ * Add setting link in the plugins list
181
+ * Use admin_url instead of home_url
182
+ * Add legend for colors
183
+ * Some code refactoring
184
+ * 1.0.2
185
+ * Fix the plugin license
186
+ * 1.0.1
187
+ * Add POT file
188
+ * Add french translation
189
+ * 1.0
190
+ * First release
191
+ * Thumbnail regenerate
192
  * Image size generation
simple_image_sizes.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /*
3
- Plugin Name: Simple Image Sizes
4
- Plugin URI: https://github.com/Rahe/simple-image-sizes
5
- Description: Add options in media setting page for images sizes
6
- Version: 3.0.7
7
- Author: Rahe
8
- Author URI: http://nicolas-juen.fr
9
- Text Domain: 'simple-image-sizes'
10
- Domain Path: /languages
11
- License: GPLv2 or later
12
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
-
14
- Copyright 2011 Nicolas JUEN (njuen@beapi.fr) - Be-API
15
-
16
- This program is free software; you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License as published by
18
- the Free Software Foundation; either version 2 of the License, or
19
- (at your option) any later version.
20
-
21
- This program is distributed in the hope that it will be useful,
22
- but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- GNU General Public License for more details.
25
-
26
- You should have received a copy of the GNU General Public License
27
- along with this program; if not, write to the Free Software
28
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
- */
30
-
31
- define( 'SIS_URL', plugin_dir_url( __FILE__ ) );
32
- define( 'SIS_DIR', plugin_dir_path( __FILE__ ) );
33
- define( 'SIS_VERSION', '3.0.7' );
34
- define( 'SIS_OPTION', 'custom_image_sizes' );
35
-
36
- // Function for easy load files
37
- function _sis_load_files( $dir, $files, $prefix = '' ) {
38
- foreach ( $files as $file ) {
39
- if ( is_file( $dir . $prefix . $file . '.php' ) ) {
40
- require_once( $dir . $prefix . $file . '.php' );
41
- }
42
- }
43
- }
44
-
45
- // Plugin client classes
46
- _sis_load_files( SIS_DIR . 'classes/', array( 'main' ) );
47
-
48
- if ( is_admin() ) {
49
- // Admins classes
50
- _sis_load_files( SIS_DIR . 'classes/admin/', array( 'main', 'post', 'media' ) );
51
- }
52
-
53
- add_action( 'plugins_loaded', 'init_sis' );
54
- function init_sis() {
55
- if ( is_admin() ) {
56
- new SIS_Admin_Main();
57
- new SIS_Admin_Post();
58
- new SIS_Admin_Media();
59
- }
60
-
61
- new SIS_Client();
62
  }
1
+ <?php
2
+ /*
3
+ Plugin Name: Simple Image Sizes
4
+ Plugin URI: https://github.com/Rahe/simple-image-sizes
5
+ Description: Add options in media setting page for images sizes
6
+ Version: 3.0.8
7
+ Author: Rahe
8
+ Author URI: http://nicolas-juen.fr
9
+ Text Domain: 'simple-image-sizes'
10
+ Domain Path: /languages
11
+ License: GPLv2 or later
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
+
14
+ Copyright 2011 Nicolas JUEN (njuen@beapi.fr) - Be-API
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; either version 2 of the License, or
19
+ (at your option) any later version.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
+ */
30
+
31
+ define( 'SIS_URL', plugin_dir_url( __FILE__ ) );
32
+ define( 'SIS_DIR', plugin_dir_path( __FILE__ ) );
33
+ define( 'SIS_VERSION', '3.0.8' );
34
+ define( 'SIS_OPTION', 'custom_image_sizes' );
35
+
36
+ // Function for easy load files
37
+ function _sis_load_files( $dir, $files, $prefix = '' ) {
38
+ foreach ( $files as $file ) {
39
+ if ( is_file( $dir . $prefix . $file . '.php' ) ) {
40
+ require_once( $dir . $prefix . $file . '.php' );
41
+ }
42
+ }
43
+ }
44
+
45
+ // Plugin client classes
46
+ _sis_load_files( SIS_DIR . 'classes/', array( 'main' ) );
47
+
48
+ if ( is_admin() ) {
49
+ // Admins classes
50
+ _sis_load_files( SIS_DIR . 'classes/admin/', array( 'main', 'post', 'media' ) );
51
+ }
52
+
53
+ add_action( 'plugins_loaded', 'init_sis' );
54
+ function init_sis() {
55
+ if ( is_admin() ) {
56
+ new SIS_Admin_Main();
57
+ new SIS_Admin_Post();
58
+ new SIS_Admin_Media();
59
+ }
60
+
61
+ new SIS_Client();
62
  }
templates/admin-js.html CHANGED
@@ -1,47 +1,47 @@
1
- <script type="text/html" id="sis-new_size">
2
- <tr valign="top" class="new_size_{{ data.size_id }} new_size">
3
- <th scope="row">
4
- <input type="text" id="new_size_{{ data.size_id }}" value="thumbnail-name">
5
- </th>
6
- <td>
7
- <input type="button" id="validate_{{ data.size_id }}" value="{{ data.validate }}" class="button-secondary action add_size_name">
8
- </td>
9
- </tr>
10
- </script>
11
- <script type="text/html" id="sis-new_size_row">
12
- <th scope="row">{{ data.size }}{{ data.size_name }}</th>
13
- <td>
14
- <input type="hidden" name="image_name" value="{{ data.size_name }}">
15
- <input type="hidden" name="custom_image_sizes[{{ data.size_name }}][custom]" value="1">
16
- <label for="custom_image_sizes[{{ data.size_name }}][w]" class="sis-label">
17
- {{ data.maximumWidth }}
18
- <input type="number" name="custom_image_sizes[{{ data.size_name }}][w]" value="1" step="1" min="0" id="custom_image_sizes[{{ data.size_name }}][w]" base_w="0" class="w small-text">
19
- </label>
20
- <label for="custom_image_sizes[{{ data.size_name }}][h]" class="sis-label">
21
- {{ data.maximumHeight }}
22
- <input type="number" name="custom_image_sizes[{{ data.size_name }}][h]" value="1" step="1" min="0" id="custom_image_sizes[{{ data.size_name }}][h]" base_h="0" class="h small-text">
23
- </label>
24
- <label for="custom_image_sizes[{{ data.size_name }}][n]" class="sis-label">
25
- {{ data.customName }}
26
- <input type="text" name="custom_image_sizes[{{ data.size_name }}][n]" id="custom_image_sizes[{{ data.size_name }}][n]" base_n="{{ data.size_name }}" class="n">
27
- </label>
28
- <span class="size_options">
29
- <label for="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]" class="c" title="{{ data.crop }}">
30
- {{ data.crop }}
31
- </label>
32
- <select type="checkbox" name="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]" base_c="0" class="c crop">
33
- <option value="0"> {{ sis.fl }} </option>
34
- <option value="1"> {{ sis.tr }} </option>
35
- <# _.each( sis.crop_positions, function( label, name ) { #>
36
- <option value="{{ name }}"> {{ label }} </option>
37
- <# }); #>
38
- </select>
39
- <input type="checkbox" name="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]" base_s="0" value="1" class="s show">
40
- <label for="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]" class="s" title="{{ data.show }}">
41
- {{ data.show }}
42
- </label>
43
- </span>
44
- <div class="delete_size button-secondary">{{ data.deleteImage }}</div>
45
- <div class="add_size button-secondary">{{ data.validateButton }}</div>
46
- </td>
47
  </script>
1
+ <script type="text/html" id="sis-new_size">
2
+ <tr valign="top" class="new_size_{{ data.size_id }} new_size">
3
+ <th scope="row">
4
+ <input type="text" id="new_size_{{ data.size_id }}" value="thumbnail-name">
5
+ </th>
6
+ <td>
7
+ <input type="button" id="validate_{{ data.size_id }}" value="{{ data.validate }}" class="button-secondary action add_size_name">
8
+ </td>
9
+ </tr>
10
+ </script>
11
+ <script type="text/html" id="sis-new_size_row">
12
+ <th scope="row">{{ data.size }}{{ data.size_name }}</th>
13
+ <td>
14
+ <input type="hidden" name="image_name" value="{{ data.size_name }}">
15
+ <input type="hidden" name="custom_image_sizes[{{ data.size_name }}][custom]" value="1">
16
+ <label for="custom_image_sizes[{{ data.size_name }}][w]" class="sis-label">
17
+ {{ data.maximumWidth }}
18
+ <input type="number" name="custom_image_sizes[{{ data.size_name }}][w]" value="1" step="1" min="0" id="custom_image_sizes[{{ data.size_name }}][w]" base_w="0" class="w small-text">
19
+ </label>
20
+ <label for="custom_image_sizes[{{ data.size_name }}][h]" class="sis-label">
21
+ {{ data.maximumHeight }}
22
+ <input type="number" name="custom_image_sizes[{{ data.size_name }}][h]" value="1" step="1" min="0" id="custom_image_sizes[{{ data.size_name }}][h]" base_h="0" class="h small-text">
23
+ </label>
24
+ <label for="custom_image_sizes[{{ data.size_name }}][n]" class="sis-label">
25
+ {{ data.customName }}
26
+ <input type="text" name="custom_image_sizes[{{ data.size_name }}][n]" id="custom_image_sizes[{{ data.size_name }}][n]" base_n="{{ data.size_name }}" class="n">
27
+ </label>
28
+ <span class="size_options">
29
+ <label for="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]" class="c" title="{{ data.crop }}">
30
+ {{ data.crop }}
31
+ </label>
32
+ <select type="checkbox" name="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]" base_c="0" class="c crop">
33
+ <option value="0"> {{ sis.fl }} </option>
34
+ <option value="1"> {{ sis.tr }} </option>
35
+ <# _.each( sis.crop_positions, function( label, name ) { #>
36
+ <option value="{{ name }}"> {{ label }} </option>
37
+ <# }); #>
38
+ </select>
39
+ <input type="checkbox" name="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]" base_s="0" value="1" class="s show">
40
+ <label for="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]" class="s" title="{{ data.show }}">
41
+ {{ data.show }}
42
+ </label>
43
+ </span>
44
+ <div class="delete_size button-secondary">{{ data.deleteImage }}</div>
45
+ <div class="add_size button-secondary">{{ data.validateButton }}</div>
46
+ </td>
47
  </script>
templates/options-media.php CHANGED
@@ -1,152 +1,153 @@
1
- <?php
2
- // Get the sizes
3
- global $_wp_additional_image_sizes, $_wp_post_type_features;
4
- ?>
5
- <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>'/>
6
- <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>'/>
7
- <input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>'/>
8
- <div id="sis-regen">
9
- <div class="wrapper" style="">
10
- <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes' ); ?> </h4>
11
- <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
12
- <thead>
13
- <tr>
14
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
15
- type="checkbox">
16
- </th>
17
- <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
18
- <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
19
- <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
20
- <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
21
- </tr>
22
- </thead>
23
- <tbody>
24
- <?php
25
- // Display the sizes in the array
26
- foreach ( get_intermediate_image_sizes() as $s ):
27
- // Don't make or numeric sizes that appear
28
- if ( is_integer( $s ) ) {
29
- continue;
30
- }
31
-
32
- // Set width
33
- $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
34
-
35
- // Set height
36
- $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
37
-
38
- //Set crop
39
- $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
40
- if ( is_numeric( $crop ) || is_bool( $crop ) ) {
41
- $crop = absint( $crop ) > 0 ? __( 'Yes', 'simple-image-sizes' ) : __( 'No', 'simple-image-sizes' );
42
- } else {
43
- $crop = Sis_Admin_Main::get_crop_position_label( implode( '_', $crop ) );
44
- }
45
-
46
- ?>
47
- <tr id="sis-<?php echo esc_attr( $s ) ?>">
48
- <th class="check-column">
49
- <input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ) ?>" name="thumbnails[]"
50
- checked="checked" value="<?php echo esc_attr( $s ); ?>"/>
51
- </th>
52
- <th>
53
- <label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $s ); ?></label>
54
- </th>
55
- <th>
56
- <label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $width ); ?> px</label>
57
- </th>
58
- <th>
59
- <label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $height ); ?> px</label>
60
- </th>
61
- <th>
62
- <label for="<?php esc_attr_e( $s ); ?>"><?php echo $crop; ?> </label>
63
- </th>
64
- </tr>
65
- <?php endforeach; ?>
66
- </tbody>
67
- <tfoot>
68
- <tr>
69
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
70
- type="checkbox">
71
- </th>
72
- <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
73
- <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
74
- <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
75
- <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
76
- </tr>
77
- </tfoot>
78
- </table>
79
-
80
- <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes' ); ?></h4>
81
- <table cellspacing="0" class="widefat page fixed sis">
82
- <thead>
83
- <tr>
84
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
85
- type="checkbox">
86
- </th>
87
- <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes' ); ?></th>
88
- </tr>
89
- </thead>
90
- <tbody>
91
- <?php
92
- // Diplay the post types table
93
- foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $ptype ):
94
- // Avoid the post_types without post thumbnails feature
95
- if ( ! isset ( $_wp_post_type_features[ $ptype->name ] ) || ! array_key_exists( 'thumbnail', $_wp_post_type_features[ $ptype->name ] ) || false == $_wp_post_type_features[ $ptype->name ] ) {
96
- continue;
97
- }
98
- ?>
99
- <tr>
100
- <th class="check-column">
101
- <label for="<?php esc_attr_e( $ptype->name ); ?>">
102
- <input type="checkbox" class="post_types" name="post_types[]" checked="checked"
103
- id="<?php echo esc_attr( $ptype->name ); ?>"
104
- value="<?php echo esc_attr( $ptype->name ); ?>"/>
105
- </label>
106
- </th>
107
- <th>
108
- <label
109
- for="<?php esc_attr_e( $ptype->name ); ?>"><em><?php echo esc_html( $ptype->labels->name ); ?></em></label>
110
- </th>
111
- </tr>
112
- <?php endforeach; ?>
113
- </tbody>
114
- <tfoot>
115
- <tr>
116
- <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked"
117
- type="checkbox"></th>
118
- <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes' ); ?></th>
119
- </tr>
120
- </tfoot>
121
- </table>
122
- </div>
123
- </div>
124
- <div class="sis">
125
- <div class="regenerate_message"></div>
126
- <div class="media-item sis">
127
- <div class="progress">
128
- <div id="sis_progress-percent" class="percent">100%</div>
129
- <div class="bar"></div>
130
- </div>
131
- </div>
132
-
133
- <div class="ui-widget time">
134
- <div class="ui-state-highlight ui-corner-all">
135
- <p>
136
- <span class="ui-icon ui-icon-info"></span>
137
- <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span
138
- class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
139
- </p>
140
- <ul class="messages"></ul>
141
- </div>
142
- </div>
143
- <div id="error_messages">
144
- <p>
145
- <ol class="messages">
146
- </ol>
147
- </p>
148
- </div>
149
- <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes' ); ?></h4><img class="thumb-img"/></div>
150
- <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild"
151
- value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ) ?>"/>
 
152
  </div>
1
+ <?php
2
+ // Get the sizes
3
+ global $_wp_additional_image_sizes, $_wp_post_type_features;
4
+ ?>
5
+ <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>'/>
6
+ <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>'/>
7
+ <input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>'/>
8
+ <div id="sis-regen">
9
+ <div class="wrapper" style="">
10
+ <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes' ); ?> </h4>
11
+ <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
12
+ <thead>
13
+ <tr>
14
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
15
+ type="checkbox">
16
+ </th>
17
+ <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
18
+ <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
19
+ <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
20
+ <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <?php
25
+ // Display the sizes in the array
26
+ foreach ( get_intermediate_image_sizes() as $s ):
27
+ // Don't make or numeric sizes that appear
28
+ if ( is_integer( $s ) ) {
29
+ continue;
30
+ }
31
+
32
+ // Set width
33
+ $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
34
+
35
+ // Set height
36
+ $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
37
+
38
+ //Set crop
39
+ $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
40
+
41
+ if ( is_numeric( $crop ) || is_bool( $crop ) || is_string( $crop ) ) {
42
+ $crop = absint( $crop ) > 0 ? __( 'Yes', 'simple-image-sizes' ) : __( 'No', 'simple-image-sizes' );
43
+ } else {
44
+ $crop = Sis_Admin_Main::get_crop_position_label( implode( '_', $crop ) );
45
+ }
46
+
47
+ ?>
48
+ <tr id="sis-<?php echo esc_attr( $s ) ?>">
49
+ <th class="check-column">
50
+ <input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ) ?>" name="thumbnails[]"
51
+ checked="checked" value="<?php echo esc_attr( $s ); ?>"/>
52
+ </th>
53
+ <th>
54
+ <label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $s ); ?></label>
55
+ </th>
56
+ <th>
57
+ <label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $width ); ?> px</label>
58
+ </th>
59
+ <th>
60
+ <label for="<?php esc_attr_e( $s ); ?>"><?php echo esc_html( $height ); ?> px</label>
61
+ </th>
62
+ <th>
63
+ <label for="<?php esc_attr_e( $s ); ?>"><?php echo $crop; ?> </label>
64
+ </th>
65
+ </tr>
66
+ <?php endforeach; ?>
67
+ </tbody>
68
+ <tfoot>
69
+ <tr>
70
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
71
+ type="checkbox">
72
+ </th>
73
+ <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
74
+ <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
75
+ <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
76
+ <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
77
+ </tr>
78
+ </tfoot>
79
+ </table>
80
+
81
+ <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes' ); ?></h4>
82
+ <table cellspacing="0" class="widefat page fixed sis">
83
+ <thead>
84
+ <tr>
85
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
86
+ type="checkbox">
87
+ </th>
88
+ <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes' ); ?></th>
89
+ </tr>
90
+ </thead>
91
+ <tbody>
92
+ <?php
93
+ // Diplay the post types table
94
+ foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $ptype ):
95
+ // Avoid the post_types without post thumbnails feature
96
+ if ( ! isset ( $_wp_post_type_features[ $ptype->name ] ) || ! array_key_exists( 'thumbnail', $_wp_post_type_features[ $ptype->name ] ) || false == $_wp_post_type_features[ $ptype->name ] ) {
97
+ continue;
98
+ }
99
+ ?>
100
+ <tr>
101
+ <th class="check-column">
102
+ <label for="<?php esc_attr_e( $ptype->name ); ?>">
103
+ <input type="checkbox" class="post_types" name="post_types[]" checked="checked"
104
+ id="<?php echo esc_attr( $ptype->name ); ?>"
105
+ value="<?php echo esc_attr( $ptype->name ); ?>"/>
106
+ </label>
107
+ </th>
108
+ <th>
109
+ <label
110
+ for="<?php esc_attr_e( $ptype->name ); ?>"><em><?php echo esc_html( $ptype->labels->name ); ?></em></label>
111
+ </th>
112
+ </tr>
113
+ <?php endforeach; ?>
114
+ </tbody>
115
+ <tfoot>
116
+ <tr>
117
+ <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked"
118
+ type="checkbox"></th>
119
+ <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes' ); ?></th>
120
+ </tr>
121
+ </tfoot>
122
+ </table>
123
+ </div>
124
+ </div>
125
+ <div class="sis">
126
+ <div class="regenerate_message"></div>
127
+ <div class="media-item sis">
128
+ <div class="progress">
129
+ <div id="sis_progress-percent" class="percent">100%</div>
130
+ <div class="bar"></div>
131
+ </div>
132
+ </div>
133
+
134
+ <div class="ui-widget time">
135
+ <div class="ui-state-highlight ui-corner-all">
136
+ <p>
137
+ <span class="ui-icon ui-icon-info"></span>
138
+ <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span
139
+ class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
140
+ </p>
141
+ <ul class="messages"></ul>
142
+ </div>
143
+ </div>
144
+ <div id="error_messages">
145
+ <p>
146
+ <ol class="messages">
147
+ </ol>
148
+ </p>
149
+ </div>
150
+ <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes' ); ?></h4><img class="thumb-img"/></div>
151
+ <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild"
152
+ value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ) ?>"/>
153
  </div>