Image Widget - Version 3.1.3

Version Description

  • Added German language support (Thank you Rdiger Wei!!!)
Download this release

Release Info

Developer peterchester
Plugin Icon 128x128 Image Widget
Version 3.1.3
Comparing to
See all releases

Code changes from version 3.1.2 to 3.1.3

image-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Image Widget
4
  Plugin URI: http://wordpress.org/extend/plugins/image-widget/
5
  Description: Simple image widget that uses native Wordpress upload thickbox to add image widgets to your site.
6
  Author: Shane and Peter, Inc.
7
- Version: 3.1.2
8
  Author URI: http://www.shaneandpeter.com
9
  */
10
 
@@ -20,6 +20,8 @@ add_action('widgets_init', 'load_sp_image_widget');
20
  * @author Shane & Peter, Inc. (Peter Chester)
21
  **/
22
  class SP_Image_Widget extends WP_Widget {
 
 
23
 
24
  /**
25
  * SP Image Widget constructor
@@ -28,9 +30,10 @@ class SP_Image_Widget extends WP_Widget {
28
  * @author Shane & Peter, Inc. (Peter Chester)
29
  */
30
  function SP_Image_Widget() {
31
- $widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', 'sp_image_widget' ) );
 
32
  $control_ops = array( 'id_base' => 'widget_sp_image' );
33
- $this->WP_Widget('widget_sp_image', __('Image Widget', 'sp_image_widget'), $widget_ops, $control_ops);
34
 
35
  global $pagenow;
36
  if (WP_ADMIN) {
@@ -47,6 +50,10 @@ class SP_Image_Widget extends WP_Widget {
47
 
48
  }
49
 
 
 
 
 
50
  /**
51
  * Retrieve resized image URL
52
  *
@@ -109,7 +116,7 @@ class SP_Image_Widget extends WP_Widget {
109
  function replace_text_in_thitckbox($translated_text, $source_text, $domain) {
110
  if ( $this->is_sp_widget_context() ) {
111
  if ('Insert into Post' == $source_text) {
112
- return __('Insert Into Widget', 'sp_image_widget' );
113
  }
114
  }
115
  return $translated_text;
@@ -260,14 +267,14 @@ class SP_Image_Widget extends WP_Widget {
260
  ) );
261
  ?>
262
 
263
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'sp_image_widget'); ?></label>
264
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['title'])); ?>" /></p>
265
 
266
- <p><label for="<?php echo $this->get_field_id('image'); ?>"><?php _e('Image:', 'sp_image_widget'); ?></label>
267
  <?php
268
  $media_upload_iframe_src = "media-upload.php?type=image&widget_id=".$this->id; //NOTE #1: the widget id is added here to allow uploader to only return array if this is used with image widget so that all other uploads are not harmed.
269
  $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src");
270
- $image_title = __(($instance['image'] ? 'Change Image' : 'Add Image'), 'sp_image_widget');
271
  ?><br />
272
  <a href="<?php echo $image_upload_iframe_src; ?>&TB_iframe=true" id="add_image-<?php echo $this->get_field_id('image'); ?>" class="thickbox-image-widget" title='<?php echo $image_title; ?>' onClick="set_active_widget('<?php echo $this->id; ?>');return false;" style="text-decoration:none"><img src='images/media-button-image.gif' alt='<?php echo $image_title; ?>' align="absmiddle" /> <?php echo $image_title; ?></a>
273
  <div id="display-<?php echo $this->get_field_id('image'); ?>"><?php
@@ -290,28 +297,28 @@ class SP_Image_Widget extends WP_Widget {
290
  <input id="<?php echo $this->get_field_id('image'); ?>" name="<?php echo $this->get_field_name('image'); ?>" type="hidden" value="<?php echo $instance['image']; ?>" />
291
  </p>
292
 
293
- <p><label for="<?php echo $this->get_field_id('description'); ?>"><?php _e('Caption:', 'sp_image_widget'); ?></label>
294
  <textarea rows="8" class="widefat" id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>"><?php echo format_to_edit($instance['description']); ?></textarea></p>
295
 
296
- <p><label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link:', 'sp_image_widget'); ?></label>
297
  <input class="widefat" id="<?php echo $this->get_field_id('link'); ?>" name="<?php echo $this->get_field_name('link'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['link'])); ?>" /><br />
298
  <select name="<?php echo $this->get_field_name('linktarget'); ?>" id="<?php echo $this->get_field_id('linktarget'); ?>">
299
- <option value="_self"<?php selected( $instance['linktarget'], '_self' ); ?>><?php _e('Stay in Window', 'sp_image_widget'); ?></option>
300
- <option value="_blank"<?php selected( $instance['linktarget'], '_blank' ); ?>><?php _e('Open New Window', 'sp_image_widget'); ?></option>
301
  </select></p>
302
 
303
- <p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:', 'sp_image_widget'); ?></label>
304
  <input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['width'])); ?>" onchange="changeImgWidth('<?php echo $this->id; ?>')" /></p>
305
 
306
- <p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:', 'sp_image_widget'); ?></label>
307
  <input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['height'])); ?>" onchange="changeImgHeight('<?php echo $this->id; ?>')" /></p>
308
 
309
- <p><label for="<?php echo $this->get_field_id('align'); ?>"><?php _e('Align:', 'sp_image_widget'); ?></label>
310
  <select name="<?php echo $this->get_field_name('align'); ?>" id="<?php echo $this->get_field_id('align'); ?>" onchange="changeImgAlign('<?php echo $this->id; ?>')">
311
- <option value="none"<?php selected( $instance['align'], 'none' ); ?>><?php _e('none', 'sp_image_widget'); ?></option>
312
- <option value="left"<?php selected( $instance['align'], 'left' ); ?>><?php _e('left', 'sp_image_widget'); ?></option>
313
- <option value="center"<?php selected( $instance['align'], 'center' ); ?>><?php _e('center', 'sp_image_widget'); ?></option>
314
- <option value="right"<?php selected( $instance['align'], 'right' ); ?>><?php _e('right', 'sp_image_widget'); ?></option>
315
  </select></p>
316
 
317
  <?php
4
  Plugin URI: http://wordpress.org/extend/plugins/image-widget/
5
  Description: Simple image widget that uses native Wordpress upload thickbox to add image widgets to your site.
6
  Author: Shane and Peter, Inc.
7
+ Version: 3.1.3
8
  Author URI: http://www.shaneandpeter.com
9
  */
10
 
20
  * @author Shane & Peter, Inc. (Peter Chester)
21
  **/
22
  class SP_Image_Widget extends WP_Widget {
23
+
24
+ public $pluginDomain = 'sp_image_widget';
25
 
26
  /**
27
  * SP Image Widget constructor
30
  * @author Shane & Peter, Inc. (Peter Chester)
31
  */
32
  function SP_Image_Widget() {
33
+ $this->loadPluginTextDomain();
34
+ $widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', $this->pluginDomain ) );
35
  $control_ops = array( 'id_base' => 'widget_sp_image' );
36
+ $this->WP_Widget('widget_sp_image', __('Image Widget', $this->pluginDomain), $widget_ops, $control_ops);
37
 
38
  global $pagenow;
39
  if (WP_ADMIN) {
50
 
51
  }
52
 
53
+ function loadPluginTextDomain() {
54
+ load_plugin_textdomain( $this->pluginDomain, false, trailingslashit(basename(dirname(__FILE__))) . 'lang/');
55
+ }
56
+
57
  /**
58
  * Retrieve resized image URL
59
  *
116
  function replace_text_in_thitckbox($translated_text, $source_text, $domain) {
117
  if ( $this->is_sp_widget_context() ) {
118
  if ('Insert into Post' == $source_text) {
119
+ return __('Insert Into Widget', $this->pluginDomain );
120
  }
121
  }
122
  return $translated_text;
267
  ) );
268
  ?>
269
 
270
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', $this->pluginDomain); ?></label>
271
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['title'])); ?>" /></p>
272
 
273
+ <p><label for="<?php echo $this->get_field_id('image'); ?>"><?php _e('Image:', $this->pluginDomain); ?></label>
274
  <?php
275
  $media_upload_iframe_src = "media-upload.php?type=image&widget_id=".$this->id; //NOTE #1: the widget id is added here to allow uploader to only return array if this is used with image widget so that all other uploads are not harmed.
276
  $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src");
277
+ $image_title = __(($instance['image'] ? 'Change Image' : 'Add Image'), $this->pluginDomain);
278
  ?><br />
279
  <a href="<?php echo $image_upload_iframe_src; ?>&TB_iframe=true" id="add_image-<?php echo $this->get_field_id('image'); ?>" class="thickbox-image-widget" title='<?php echo $image_title; ?>' onClick="set_active_widget('<?php echo $this->id; ?>');return false;" style="text-decoration:none"><img src='images/media-button-image.gif' alt='<?php echo $image_title; ?>' align="absmiddle" /> <?php echo $image_title; ?></a>
280
  <div id="display-<?php echo $this->get_field_id('image'); ?>"><?php
297
  <input id="<?php echo $this->get_field_id('image'); ?>" name="<?php echo $this->get_field_name('image'); ?>" type="hidden" value="<?php echo $instance['image']; ?>" />
298
  </p>
299
 
300
+ <p><label for="<?php echo $this->get_field_id('description'); ?>"><?php _e('Caption:', $this->pluginDomain); ?></label>
301
  <textarea rows="8" class="widefat" id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>"><?php echo format_to_edit($instance['description']); ?></textarea></p>
302
 
303
+ <p><label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link:', $this->pluginDomain); ?></label>
304
  <input class="widefat" id="<?php echo $this->get_field_id('link'); ?>" name="<?php echo $this->get_field_name('link'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['link'])); ?>" /><br />
305
  <select name="<?php echo $this->get_field_name('linktarget'); ?>" id="<?php echo $this->get_field_id('linktarget'); ?>">
306
+ <option value="_self"<?php selected( $instance['linktarget'], '_self' ); ?>><?php _e('Stay in Window', $this->pluginDomain); ?></option>
307
+ <option value="_blank"<?php selected( $instance['linktarget'], '_blank' ); ?>><?php _e('Open New Window', $this->pluginDomain); ?></option>
308
  </select></p>
309
 
310
+ <p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:', $this->pluginDomain); ?></label>
311
  <input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['width'])); ?>" onchange="changeImgWidth('<?php echo $this->id; ?>')" /></p>
312
 
313
+ <p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:', $this->pluginDomain); ?></label>
314
  <input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['height'])); ?>" onchange="changeImgHeight('<?php echo $this->id; ?>')" /></p>
315
 
316
+ <p><label for="<?php echo $this->get_field_id('align'); ?>"><?php _e('Align:', $this->pluginDomain); ?></label>
317
  <select name="<?php echo $this->get_field_name('align'); ?>" id="<?php echo $this->get_field_id('align'); ?>" onchange="changeImgAlign('<?php echo $this->id; ?>')">
318
+ <option value="none"<?php selected( $instance['align'], 'none' ); ?>><?php _e('none', $this->pluginDomain); ?></option>
319
+ <option value="left"<?php selected( $instance['align'], 'left' ); ?>><?php _e('left', $this->pluginDomain); ?></option>
320
+ <option value="center"<?php selected( $instance['align'], 'center' ); ?>><?php _e('center', $this->pluginDomain); ?></option>
321
+ <option value="right"<?php selected( $instance['align'], 'right' ); ?>><?php _e('right', $this->pluginDomain); ?></option>
322
  </select></p>
323
 
324
  <?php
lang/SP_Image_Widget-de_DE.mo ADDED
Binary file
lang/SP_Image_Widget-de_DE.po ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation of the Image Widget 3.1.3 WordPress plugin.
2
+ # This file is distributed under the same license as the the Image Widget package.
3
+ # Rüdiger Weiß <ruediger@mac.com>, 2010.
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Image Widget 3.1.3\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "POT-Creation-Date: 2010-01-30 14:15+0100\n"
10
+ "PO-Revision-Date: 2010-01-30 15:24+0100\n"
11
+ "Last-Translator: Rüdiger Weiß <ruediger@mac.com>\n"
12
+ "Language-Team: Rüdiger Weiß <ruediger@mac.com>\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=UTF-8\n"
15
+ "Content-Transfer-Encoding: 8bit\n"
16
+ "X-Poedit-Language: German\n"
17
+ "X-Poedit-Country: GERMANY\n"
18
+ "X-Poedit-SourceCharset: iso-8859-1\n"
19
+ "X-Poedit-KeywordsList: __;_e\n"
20
+ "X-Poedit-Basepath: .\n"
21
+
22
+ #: image-widget.php:33
23
+ msgid "Showcase a single image with a Title, URL, and a Description"
24
+ msgstr "Ein einzelnes Bild mit Text"
25
+
26
+ #: image-widget.php:35
27
+ msgid "Image Widget"
28
+ msgstr "Bild Widget"
29
+
30
+ #: image-widget.php:114
31
+ msgid "Insert Into Widget"
32
+ msgstr "In Widget &uuml;bernehmen"
33
+
34
+ #: image-widget.php:265
35
+ msgid "Title:"
36
+ msgstr "Titel:"
37
+
38
+ #: image-widget.php:268
39
+ msgid "Image:"
40
+ msgstr "Bild:"
41
+
42
+ #: image-widget.php:272
43
+ msgid "Change Image"
44
+ msgstr "Bild &auml;ndern"
45
+
46
+ #: image-widget.php:272
47
+ msgid "Add Image"
48
+ msgstr "Bild einf&uuml;gen"
49
+
50
+ #: image-widget.php:295
51
+ msgid "Caption:"
52
+ msgstr "Bildunterschrift:"
53
+
54
+ #: image-widget.php:298
55
+ msgid "Link:"
56
+ msgstr "Link:"
57
+
58
+ #: image-widget.php:301
59
+ msgid "Stay in Window"
60
+ msgstr "im gleichen Fenster &ouml;ffnen"
61
+
62
+ #: image-widget.php:302
63
+ msgid "Open New Window"
64
+ msgstr "im neuen Fenster &ouml;ffnen"
65
+
66
+ #: image-widget.php:305
67
+ msgid "Width:"
68
+ msgstr "Breite:"
69
+
70
+ #: image-widget.php:308
71
+ msgid "Height:"
72
+ msgstr "H&ouml;he:"
73
+
74
+ #: image-widget.php:311
75
+ msgid "Align:"
76
+ msgstr "Ausrichtung:"
77
+
78
+ #: image-widget.php:313
79
+ msgid "none"
80
+ msgstr "ohne"
81
+
82
+ #: image-widget.php:314
83
+ msgid "left"
84
+ msgstr "links"
85
+
86
+ #: image-widget.php:315
87
+ msgid "center"
88
+ msgstr "zentriert"
89
+
90
+ #: image-widget.php:316
91
+ msgid "right"
92
+ msgstr "rechts"
93
+
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Image Widget ===
2
  Contributors: Shane & Peter, Inc.
3
- Donate link: http://www.shaneandpeter.com
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, admin, thickbox, resize
5
  Requires at least: 2.8
6
- Tested up to: 2.9.1
7
- Stable tag: 3.1.2
8
 
9
  == Description ==
10
 
@@ -17,6 +17,12 @@ Simple image widget that uses native Wordpress upload thickbox to add image widg
17
  * Very versatile. All fields are optional.
18
  * Upload, link to external image, or select an image from your media collection using the built in thickbox browser.
19
 
 
 
 
 
 
 
20
  == Installation ==
21
 
22
  = Install =
@@ -33,12 +39,18 @@ Simple image widget that uses native Wordpress upload thickbox to add image widg
33
 
34
  If you find any bugs or have any ideas, please mail us.
35
 
 
 
36
  == Changelog ==
37
 
 
 
 
 
38
  = 3.1.2 =
39
 
40
  * Fix bug: XHTML Compliance (thanks HGU for offering a patch and thanks webmasterlistingarts for filing the bug)
41
- * Replaced <p> with <div> in description to also improve XHTML compliance.
42
 
43
  = 3.1.1 =
44
 
@@ -104,7 +116,7 @@ Thank you smurkas, squigie and laurie!!! Special thanks to Cameron Clark from h
104
 
105
  = 2.2.1 =
106
 
107
- * Update <div> to be <li> (Thanks to Lois Turley)
108
 
109
  = 2.2 =
110
 
@@ -124,5 +136,15 @@ Thank you smurkas, squigie and laurie!!! Special thanks to Cameron Clark from h
124
  == Screenshots ==
125
 
126
  1. Image Widget admin screen.
127
- 2. Thickbox uploader for the Image Widget
128
- 3. Image Widget on the front of a plain Wordpress install.
 
 
 
 
 
 
 
 
 
 
1
  === Image Widget ===
2
  Contributors: Shane & Peter, Inc.
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BSPTNFFY6AL6
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, admin, thickbox, resize
5
  Requires at least: 2.8
6
+ Tested up to: 2.9.1.1
7
+ Stable tag: 3.1.3
8
 
9
  == Description ==
10
 
17
  * Very versatile. All fields are optional.
18
  * Upload, link to external image, or select an image from your media collection using the built in thickbox browser.
19
 
20
+ This plugin is actively supported and we will do our best to help you. In return we simply as 3 things:
21
+
22
+ 1. Help Out. If you see a question on the forum you can help with or have a great idea and want to code it up and submit a patch, that would be just plain awesome and we will shower your with praise. Might even be a good way to get to know us and lead to some paid work if you freelance.
23
+ 1. Donate - if this is generating enough revenue to support our time it makes all the difference in the world
24
+ https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BSPTNFFY6AL6
25
+
26
  == Installation ==
27
 
28
  = Install =
39
 
40
  If you find any bugs or have any ideas, please mail us.
41
 
42
+ Please visit the forum for questions or comments: http://wordpress.org/tags/image-widget/
43
+
44
  == Changelog ==
45
 
46
+ = 3.1.3 =
47
+
48
+ * Added German language support (Thank you Rüdiger Weiß!!!)
49
+
50
  = 3.1.2 =
51
 
52
  * Fix bug: XHTML Compliance (thanks HGU for offering a patch and thanks webmasterlistingarts for filing the bug)
53
+ * Replaced `<p>` with `<div>` in description to also improve XHTML compliance.
54
 
55
  = 3.1.1 =
56
 
116
 
117
  = 2.2.1 =
118
 
119
+ * Update `<div>` to be `<li>` (Thanks to Lois Turley)
120
 
121
  = 2.2 =
122
 
136
  == Screenshots ==
137
 
138
  1. Image Widget admin screen.
139
+ 1. Thickbox uploader for the Image Widget
140
+ 1. Image Widget on the front of a plain Wordpress install.
141
+
142
+ == Frequently Asked Questions ==
143
+
144
+ = Where do I go to file a bug or ask a question? =
145
+
146
+ Please visit the forum for questions or comments: http://wordpress.org/tags/image-widget/
147
+
148
+ == Upgrade Notice ==
149
+
150
+ This upgrade should have no impact on existing installs.