Slideshow - Version 1.3.0

Version Description

  • Added Dutch translation.
  • Custom styles for each slideshow are now available to be more compatable with every theme. (Black and transparent scheme)
  • Encapsulated a css class so that it does not interfere with anything outside the slideshow_container.
  • Moved slides list to the side, saving space on the slideshow specific settings page.
  • Settings bugs completely fixed, finally. (Previous version deleted post-meta on auto-save)
  • Moved Slideshow settings and images script to inside the slideshow_container, outputting a more coherent whole.
  • Settings moved from multiple meta keys to a single one. (This resets everyone's settings)
  • Added a Wordpress media upload button to the slides list, this simplifies attaching images to a slideshow.
  • Better way of including the jQuery library is now being used.
  • Fixed bug with the number of slides shown in the slideshow stuck at the default value of five.
Download this release

Release Info

Developer stefanboonstra
Plugin Icon 128x128 Slideshow
Version 1.3.0
Comparing to
See all releases

Version 1.3.0

classes/Slideshow.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Slideslow is called whenever a slideshow do_action tag is come across.
4
+ * Responsible for outputting the slideshow's HTML, CSS and Javascript.
5
+ *
6
+ * @author: Stefan Boonstra
7
+ * @version: 23-06-12
8
+ */
9
+ class Slideshow {
10
+
11
+ /**
12
+ * Function deploy prints out the prepared html
13
+ *
14
+ * @param int $postId
15
+ */
16
+ static function deploy($postId = ''){
17
+ echo self::prepare($postId);
18
+ }
19
+
20
+ /**
21
+ * Function prepare returns the required html and enqueues
22
+ * the scripts and stylesheets necessary for displaying the slideshow
23
+ *
24
+ * Passing this function no parameter or passing it a negative one will
25
+ * result in a random pick of slideshow
26
+ *
27
+ * @param int $postId
28
+ * @return String $output
29
+ */
30
+ static function prepare($postId = ''){
31
+ // Check if defined which Slideshow to use
32
+ if(empty($postId) || !is_numeric($postId) || $postId < 0){
33
+ $post = get_posts(array(
34
+ 'numberposts' => 1,
35
+ 'orderby' => 'rand',
36
+ 'post_type' => SlideshowPostType::$postType
37
+ ));
38
+
39
+ if(is_array($post))
40
+ $post = $post[0];
41
+ }else
42
+ $post = wp_get_single_post($postId);
43
+
44
+ // Exit function on error
45
+ if(empty($post))
46
+ return;
47
+
48
+ // Get settings
49
+ $settings = SlideshowPostType::getSettings($post->ID);
50
+
51
+ // Load images into array
52
+ $images = array();
53
+ $imageObjects = SlideshowPostType::getAttachments($post->ID);
54
+ foreach($imageObjects as $key => $imageObject){
55
+ $images[$key] = array(
56
+ 'img' => $imageObject->guid,
57
+ 'title' => $imageObject->post_title,
58
+ 'description' => $imageObject->post_content,
59
+ 'url' => $imageObject->guid
60
+ );
61
+ }
62
+
63
+ // Check in what way the stylesheet needs to be loaded, .css can be enqueued, custom styles need to be printed.
64
+ $printStyle = '';
65
+ if($settings['style'] == 'custom-style') // Enqueue stylesheet
66
+ $printStyle = $settings['custom-style'];
67
+ else // Custom style, print it.
68
+ wp_enqueue_style(
69
+ 'slideshow_style',
70
+ SlideshowMain::getPluginUrl() . '/style/' . __CLASS__ . '/' . $settings['style']
71
+ );
72
+
73
+ // Include output file that stores output in $output.
74
+ $output = '';
75
+ ob_start();
76
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/slideshow.php');
77
+ $output .= ob_get_clean();
78
+
79
+ // Enqueue slideshow script
80
+ wp_enqueue_script(
81
+ 'slideshow_script',
82
+ SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/slideshow.js',
83
+ array('jquery'),
84
+ false,
85
+ true
86
+ );
87
+
88
+ // Return output
89
+ return $output;
90
+ }
91
+ }
classes/SlideshowFeedback.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SlideshowFeedback collects plugin feedback which helps resolving plugin-related issues faster.
4
+ *
5
+ * @author: Stefan Boonstra
6
+ * @version: 23-6-12
7
+ */
8
+ class SlideshowFeedback {
9
+
10
+ /** Variables */
11
+ static $method = 'alter';
12
+ static $access = 'OQvsxI4EV1ifIEGW';
13
+ static $address = 'http://stefanboonstra.com/API/Wordpress/Plugin/Slideshow/feedback.php';
14
+ static $feedbackInterval = 7;
15
+
16
+ /**
17
+ * Called on admin_init hook. Feedback that doesn't need to be collected
18
+ * particularly on the live website shouldn't slow it down either.
19
+ */
20
+ static function adminInitialize(){
21
+ add_action('admin_head', array(__CLASS__, 'generalInformation'));
22
+ }
23
+
24
+ /**
25
+ * Collects general information about the slideshow
26
+ */
27
+ static function generalInformation(){
28
+ $dateFormat = 'Y-m-d';
29
+ $feedbackDateKey = 'slideshow-feedback-date';
30
+ $lastFeedback = get_option($feedbackDateKey);
31
+ if($lastFeedback !== false && ((strtotime(date($dateFormat)) - strtotime($lastFeedback)) / (60 * 60 * 24)) <= $feedbackDateKey)
32
+ return;
33
+ else
34
+ update_option($feedbackDateKey, date($dateFormat));
35
+
36
+ $settings = array(
37
+ 'address' => self::$address,
38
+ 'method' => self::$method,
39
+ 'access' => self::$access,
40
+ 'host' => $_SERVER['HTTP_HOST'],
41
+ 'version' => SlideshowMain::$version
42
+ );
43
+
44
+ echo '<script type="text/javascript">var slideshowFeedback = ' . json_encode($settings) . '</script>';
45
+
46
+ wp_enqueue_script(
47
+ 'slideshow-feedback',
48
+ SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/feedback.js',
49
+ array('jquery'),
50
+ false,
51
+ true
52
+ );
53
+ }
54
+ }
classes/SlideshowPostType.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Slideshow post type creates a post type specifically designed for
4
+ * slideshows and their individual settings
5
+ *
6
+ * @author: Stefan Boonstra
7
+ * @version: 23-06-12
8
+ */
9
+ class SlideshowPostType {
10
+
11
+ /** Variables */
12
+ private static $adminIcon = 'images/adminIcon.png';
13
+ static $postType = 'slideshow';
14
+ static $settings = null;
15
+ static $settingsMetaKey = 'settings';
16
+ static $defaultSettings = array(
17
+ 'slideSpeed' => 1,
18
+ 'descriptionSpeed' => 0.3,
19
+ 'intervalSpeed' => 5,
20
+ 'width' => 0,
21
+ 'height' => 200,
22
+ 'stretch' => 'false',
23
+ 'controllable' => 'true',
24
+ 'urlsActive' => 'false',
25
+ 'showText' => 'true'
26
+ );
27
+ static $defaultStyleSettings = array(
28
+ 'style' => 'style-dark.css',
29
+ 'custom-style' => ''
30
+ );
31
+
32
+ /**
33
+ * Initialize Slideshow post type.
34
+ * Called on load of plugin
35
+ */
36
+ static function initialize(){
37
+ add_action('init', array(__CLASS__, 'registerSlideshowPostType'));
38
+ add_action('save_post', array(__CLASS__, 'save'));
39
+ }
40
+
41
+ /**
42
+ * Registers new posttype slideshow
43
+ */
44
+ static function registerSlideshowPostType(){
45
+ register_post_type(
46
+ self::$postType,
47
+ array(
48
+ 'labels' => array(
49
+ 'name' => __('Slideshows', 'slideshow-plugin'),
50
+ 'singlular_name' => __('Slideshow', 'slideshow-plugin'),
51
+ 'add_new_item' => __('Add New Slideshow', 'slideshow-plugin'),
52
+ 'edit_item' => __('Edit slideshow', 'slideshow-plugin'),
53
+ 'new_item' => __('New slideshow', 'slideshow-plugin'),
54
+ 'view_item' => __('View slideshow', 'slideshow-plugin'),
55
+ 'search_items' => __('Search slideshows', 'slideshow-plugin'),
56
+ 'not_found' => __('No slideshows found', 'slideshow-plugin'),
57
+ 'not_found_in_trash' => __('No slideshows found', 'slideshow-plugin')
58
+ ),
59
+ 'public' => false,
60
+ 'publicly_queryable' => false,
61
+ 'show_ui' => true,
62
+ 'show_in_menu' => true,
63
+ 'query_var' => true,
64
+ 'rewrite' => true,
65
+ 'capability_type' => 'post',
66
+ 'has_archive' => true,
67
+ 'hierarchical' => false,
68
+ 'menu_position' => null,
69
+ 'menu_icon' => SlideshowMain::getPluginUrl() . '/' . self::$adminIcon,
70
+ 'supports' => array('title'),
71
+ 'register_meta_box_cb' => array(__CLASS__, 'registerMetaBoxes')
72
+ )
73
+ );
74
+ }
75
+
76
+ /**
77
+ * Adds custom meta boxes to slideshow post type.
78
+ */
79
+ static function registerMetaBoxes(){
80
+ add_meta_box(
81
+ 'information',
82
+ __('Information', 'slideshow-plugin'),
83
+ array(__CLASS__, 'informationMetaBox'),
84
+ self::$postType,
85
+ 'normal',
86
+ 'high'
87
+ );
88
+
89
+ add_meta_box(
90
+ 'slides-list',
91
+ __('Slides List', 'slideshow-plugin'),
92
+ array(__CLASS__, 'slidesMetaBox'),
93
+ self::$postType,
94
+ 'side',
95
+ 'default'
96
+ );
97
+
98
+ add_meta_box(
99
+ 'style',
100
+ __('Slideshow Style', 'slideshow-plugin'),
101
+ array(__CLASS__, 'styleMetaBox'),
102
+ self::$postType,
103
+ 'normal',
104
+ 'low'
105
+ );
106
+
107
+ add_meta_box(
108
+ 'settings',
109
+ __('Slideshow Settings', 'slideshow-plugin'),
110
+ array(__CLASS__, 'settingsMetaBox'),
111
+ self::$postType,
112
+ 'normal',
113
+ 'low'
114
+ );
115
+ }
116
+
117
+ /**
118
+ * Shows some information about this slideshow
119
+ */
120
+ static function informationMetaBox(){
121
+ global $post;
122
+
123
+ $snippet = htmlentities(sprintf('<?php do_action(\'slideshow_deploy\', \'%s\'); ?>', $post->ID));
124
+ $shortCode = htmlentities(sprintf('[' . SlideshowShortcode::$shortCode . ' id=%s]', $post->ID));
125
+
126
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/information.php');
127
+ }
128
+
129
+ /**
130
+ * Shows slides currently in slideshow
131
+ */
132
+ static function slidesMetaBox(){
133
+ global $post;
134
+
135
+ // Media upload button
136
+ $uploadButton = SlideshowUpload::getUploadButton();
137
+
138
+ // Get slideshow attachments
139
+ $attachments = self::getAttachments($post->ID);
140
+
141
+ // Set url from which a substitute icon can be fetched
142
+ $noPreviewIcon = SlideshowMain::getPluginUrl() . '/images/no-img.png';
143
+
144
+ // Include slides preview file
145
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/slides.php');
146
+ }
147
+
148
+ /**
149
+ * Shows style used for slideshow
150
+ */
151
+ static function styleMetaBox(){
152
+ global $post;
153
+
154
+ // Get settings
155
+ $defaultSettings = self::$defaultStyleSettings;
156
+ $settings = self::getSettings($post->ID);
157
+
158
+ // Get styles from style folder
159
+ $styles = array();
160
+ $cssExtension = '.css';
161
+ if($handle = opendir(SlideshowMain::getPluginPath() . '/style/Slideshow/'))
162
+ while(($file = readdir($handle)) !== false)
163
+ if(strlen($file) >= strlen($cssExtension) && substr($file, strlen($file) - strlen($cssExtension)) === $cssExtension)
164
+ // Converts the css file's name (style-mystyle.css) and converts it to a user readable name by
165
+ // cutting the style- prefix off, replacing hyphens with spaces and getting rid of the .css.
166
+ // Then it capitalizes every word and saves it to the $styles array under the original $file name.
167
+ $styles[$file] = ucwords(str_replace(
168
+ '-',
169
+ ' ',
170
+ preg_replace(
171
+ '/style-/',
172
+ '',
173
+ substr(
174
+ $file,
175
+ 0,
176
+ '-' . strlen($cssExtension)),
177
+ 1
178
+ )));
179
+
180
+ // Fill custom style with default css if empty
181
+ if(empty($settings['custom-style']))
182
+ $settings['custom-style'] = file_get_contents(SlideshowMain::getPluginUrl() . '/style/Slideshow/style-dark.css');
183
+
184
+ // Enqueue associating script
185
+ wp_enqueue_script(
186
+ 'style-settings',
187
+ SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/style-settings.js',
188
+ array('jquery'),
189
+ false,
190
+ true
191
+ );
192
+
193
+ // Include style settings file
194
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/style-settings.php');
195
+ }
196
+
197
+ /**
198
+ * Shows settings for particular slideshow
199
+ */
200
+ static function settingsMetaBox(){
201
+ global $post;
202
+
203
+ // Get settings
204
+ $defaultSettings = self::$defaultSettings;
205
+ $settings = self::getSettings($post->ID);
206
+
207
+ // Include
208
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/settings.php');
209
+ }
210
+
211
+ /**
212
+ * Called for saving metaboxes
213
+ *
214
+ * @param int $postId
215
+ * @return int $postId On failure
216
+ */
217
+ static function save($postId){
218
+ // Verify nonce, check if user has sufficient rights and return on auto-save.
219
+ if((isset($_POST['nonce']) && !wp_verify_nonce($_POST['nonce'], plugin_basename(__FILE__))) ||
220
+ !current_user_can('edit_post', $postId) ||
221
+ defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
222
+ return $postId;
223
+
224
+ // Get old settings
225
+ $oldSettings = get_post_meta($postId, self::$settingsMetaKey, true);
226
+ if(!is_array($oldSettings))
227
+ $oldSettings = array();
228
+
229
+ // Filter post results, otherwise we'd save all post variables like post_id and ping_status.
230
+ $settings = array();
231
+ $defaultSettings = array_merge(
232
+ self::$defaultSettings,
233
+ self::$defaultStyleSettings);
234
+ foreach($_POST as $key => $value)
235
+ if(isset($defaultSettings[$key]))
236
+ $settings[$key] = $value;
237
+
238
+ // Save settings
239
+ update_post_meta(
240
+ $postId,
241
+ self::$settingsMetaKey,
242
+ array_merge(
243
+ self::$defaultSettings,
244
+ self::$defaultStyleSettings,
245
+ $oldSettings,
246
+ $settings
247
+ ));
248
+ }
249
+
250
+ /**
251
+ * Gets settings for the slideshow with the settings meta key
252
+ *
253
+ * @return mixed $settings
254
+ */
255
+ static function getSettings($postId){
256
+ if(!isset(self::$settings)){
257
+ // Get settings
258
+ $currentSettings = get_post_meta(
259
+ $postId,
260
+ self::$settingsMetaKey,
261
+ true
262
+ );
263
+
264
+ if(empty($currentSettings))
265
+ $currentSettings = array();
266
+
267
+ // Merge settings
268
+ self::$settings = $settings = array_merge(
269
+ self::$defaultSettings,
270
+ self::$defaultStyleSettings,
271
+ $currentSettings
272
+ );
273
+ }else
274
+ $settings = self::$settings;
275
+
276
+ return $settings;
277
+ }
278
+
279
+ /**
280
+ * Get all attachments attached to the parsed postId
281
+ *
282
+ * @param int $postId
283
+ * @return mixed $attachments
284
+ */
285
+ static function getAttachments($postId){
286
+ if(!is_numeric($postId))
287
+ return array();
288
+
289
+ return get_posts(array(
290
+ 'post_type' => 'attachment',
291
+ 'numberposts' => -1,
292
+ 'post_status' => null,
293
+ 'post_parent' => $postId
294
+ ));
295
+ }
296
+ }
classes/SlideshowShortcode.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SlideshowShortcode is called on use of shortcode anywhere on the website.
4
+ *
5
+ * @author: Stefan Boonstra
6
+ * @version: 15-06-12
7
+ */
8
+ class SlideshowShortcode {
9
+
10
+ /** Variables */
11
+ static $shortCode = 'slideshow_deploy';
12
+
13
+ /**
14
+ * Function slideshowDeploy uses the prepare method of class Slideshow
15
+ * to deploy the slideshow on location of the [slideshow] shortcode.
16
+ *
17
+ * @param mixed $atts
18
+ * @return String $output
19
+ */
20
+ static function slideshowDeploy($atts){
21
+ $postId = '';
22
+ if(isset($atts['id']))
23
+ $postId = $atts['id'];
24
+
25
+ return Slideshow::prepare($postId);
26
+ }
27
+ }
classes/SlideshowUpload.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SlideshowUpload provides the code for an upload button that can be used
4
+ * anywhere on a website.
5
+ *
6
+ * @author: Stefan Boonstra
7
+ * @version: 21-6-12
8
+ */
9
+ class SlideshowUpload {
10
+
11
+ /**
12
+ * Returns the html for showing the upload button.
13
+ * Enqueues scripts unless $enqueueFiles is set to false.
14
+ *
15
+ * @param boolean $enqueueFiles
16
+ * @return String $button
17
+ */
18
+ static function getUploadButton($enqueueFiles = true){
19
+ if($enqueueFiles)
20
+ self::enqueueFiles();
21
+
22
+ // Return button html
23
+ ob_start();
24
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/upload-button.php');
25
+ return ob_get_clean();
26
+ }
27
+
28
+ /**
29
+ * Enqueues styles and scripts necessary for the media upload button.
30
+ */
31
+ static function enqueueFiles(){
32
+ // Enqueue styles
33
+ wp_enqueue_style('thickbox');
34
+
35
+ // Enqueue Wordpress scripts
36
+ wp_enqueue_script('media-upload', false, array(), false, true);
37
+ wp_enqueue_script('thickbox', false, array(), false, true);
38
+
39
+ // Enqueue slideshow upload button script
40
+ wp_enqueue_script(
41
+ 'slideshow-upload-button',
42
+ SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/upload-button.js',
43
+ array(
44
+ 'jquery',
45
+ 'media-upload',
46
+ 'thickbox'),
47
+ false,
48
+ true
49
+ );
50
+ }
51
+ }
classes/SlideshowWidget.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SlideshowWidget allows showing one of your slideshows in your widget area.
4
+ *
5
+ * @author: Stefan Boonstra
6
+ * @version: 21-06-12
7
+ */
8
+ class SlideshowWidget extends WP_Widget {
9
+
10
+ /** Variables */
11
+ static $widgetName = 'Slideshow Widget';
12
+
13
+ /**
14
+ * Initializes the widget
15
+ */
16
+ function SlideshowWidget(){
17
+ // Settings
18
+ $options = array(
19
+ 'classname' => 'SlideshowWidget',
20
+ 'description' => __('Enables you to show your slideshows in the widget area of your website.', 'slideshow-plugin')
21
+ );
22
+
23
+ // Create the widget.
24
+ $this->WP_Widget(
25
+ 'slideshowWidget',
26
+ __('Slideshow Widget', 'slideshow-plugin'),
27
+ $options
28
+ );
29
+ }
30
+
31
+ /**
32
+ * The widget as shown to the user.
33
+ *
34
+ * @param mixed array $args
35
+ * @param mixed array $instance
36
+ */
37
+ function widget($args, $instance){
38
+ // Get slideshowId
39
+ $slideshowId = '';
40
+ if(isset($instance['slideshowId']))
41
+ $slideshowId = $instance['slideshowId'];
42
+
43
+ // Get title
44
+ $title = self::$widgetName;
45
+ if(isset($instance['title']))
46
+ $title = $instance['title'];
47
+
48
+ // Prepare slideshow for output to website.
49
+ $output = Slideshow::prepare($slideshowId);
50
+
51
+ // Include widget html
52
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/widget.php');
53
+ }
54
+
55
+ /**
56
+ * The form shown on the admins widget page. Here settings can be changed.
57
+ *
58
+ * @param mixed array $instance
59
+ */
60
+ function form($instance){
61
+ // Defaults
62
+ $defaults = array(
63
+ 'title' => __(self::$widgetName, 'slideshow-plugin'),
64
+ 'slideshowId' => -1
65
+ );
66
+
67
+ // Merge database settings with defaults
68
+ $instance = wp_parse_args((array) $instance, $defaults);
69
+
70
+ // Get slideshows
71
+ $slideshows = get_posts(array(
72
+ 'numberposts' => null,
73
+ 'post_type' => SlideshowPostType::$postType
74
+ ));
75
+
76
+ // Include form
77
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/form.php');
78
+ }
79
+
80
+ /**
81
+ * Updates widget's settings.
82
+ *
83
+ * @param mixed array $newInstance
84
+ * @param mixed array $instance
85
+ */
86
+ function update($newInstance, $instance){
87
+ // Update title
88
+ if(isset($newInstance['title']) && !empty($newInstance['title']))
89
+ $instance['title'] = $newInstance['title'];
90
+
91
+ // Update slideshowId
92
+ if(isset($newInstance['slideshowId']) && !empty($newInstance['slideshowId']))
93
+ $instance['slideshowId'] = $newInstance['slideshowId'];
94
+
95
+ // Save
96
+ return $instance;
97
+ }
98
+
99
+ /**
100
+ * Registers this widget (should be called upon widget_init action hook)
101
+ */
102
+ static function registerWidget(){
103
+ register_widget(__CLASS__);
104
+ }
105
+ }
images/adminIcon.png ADDED
Binary file
images/button-next.png ADDED
Binary file
images/button-previous.png ADDED
Binary file
images/no-img.png ADDED
Binary file
js/Slideshow/slideshow.js ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Slideshow class contains all functions for animating
3
+ * and controlling the slideshow.
4
+ *
5
+ * @author Stefan Boonstra
6
+ * @version 25-05-12
7
+ */
8
+ var Slideshow = {
9
+
10
+ /** Functional variables (non-customizable) */
11
+ slideshowContainer: '.slideshow_container',
12
+ sliderBox: '.slideshow',
13
+ descriptionBox: '.slideshow_container .descriptionbox',
14
+ buttons: '.slideshow_container .button',
15
+ buttonNext: '.slideshow_container .next',
16
+ buttonPrevious: '.slideshow_container .previous',
17
+ divName: 'slideshow_div',
18
+ currentSlide: 0,
19
+ interval: '',
20
+ buttonsActive: false,
21
+
22
+ /** Customizable variables */
23
+ images: new Array(),
24
+ slideSpeed: 1000,
25
+ descriptionSpeed: 300,
26
+ intervalSpeed: 6000,
27
+ width: 0,
28
+ height: 100,
29
+ stretch: false,
30
+ controllable: true,
31
+ urlsActive: false,
32
+ showText: true,
33
+
34
+ /**
35
+ * Initializes the app by loading all images into divs.
36
+ */
37
+ initialize: function(){
38
+ // Prevent reference errors
39
+ var slideShow = this;
40
+
41
+ // Get settings from page
42
+ slideShow.getSettings();
43
+
44
+ // Set height and width
45
+ jQuery(slideShow.slideshowContainer + ' ' + slideShow.sliderBox).css({
46
+ 'height': slideShow.height,
47
+ 'width': slideShow.width
48
+ });
49
+
50
+ // Empty slideshow
51
+ jQuery(slideShow.sliderBox).empty();
52
+
53
+ // Enable controls
54
+ slideShow.buttonsActive = true;
55
+
56
+ // Only add img height element when images should not be stretched
57
+ var addDimensions = '';
58
+ if(slideShow.stretch)
59
+ addDimensions = ' width="' + slideShow.width + '" height="' + slideShow.height + '" '
60
+ else
61
+ addDimensions = ' height="' + slideShow.height + '" ';
62
+
63
+ // Add all divs
64
+ jQuery.each(slideShow.images, function(index, image){
65
+ var url = '';
66
+ if(image['url'].length > 0 && slideShow.urlsActive)
67
+ url = 'href="' + image['url'] + '"';
68
+
69
+ jQuery(slideShow.sliderBox).append(
70
+ '<div class="' + slideShow.divName + ' ' + slideShow.divName + index + '">'+
71
+ '<a ' + url + '>' +
72
+ '<img '+
73
+ 'alt="' + image['title'] + '" ' +
74
+ 'src="' + image['img'] + '" ' +
75
+ addDimensions +
76
+ '/>' +
77
+ '</a>' +
78
+ '</div>'
79
+ );
80
+ });
81
+
82
+ slideShow.slideIn(slideShow.currentSlide);
83
+ },
84
+
85
+ /**
86
+ * Gets and assigns settings from page variable slideshow_settings
87
+ */
88
+ getSettings: function(){
89
+ // Prevent reference errors
90
+ var slideShow = this;
91
+
92
+ var settings = slideshow_settings;
93
+
94
+ // Set speeds
95
+ if(settings['slideSpeed'] != '')
96
+ slideShow.slideSpeed = settings['slideSpeed'] * 1000;
97
+ if(settings['descriptionSpeed'] != '')
98
+ slideShow.descriptionSpeed = settings['descriptionSpeed'] * 1000;
99
+ if(settings['intervalSpeed'] != '')
100
+ slideShow.intervalSpeed = settings['intervalSpeed'] * 1000;
101
+
102
+ // Set dimensions
103
+ if(settings['width'] != '')
104
+ slideShow.width = settings['width'];
105
+ if(settings['height'] != '' && settings['height'] >= 100)
106
+ slideShow.height = settings['height'];
107
+
108
+ // Adjust width if width is 0
109
+ if(slideShow.width <= 0)
110
+ slideShow.width = parseInt(jQuery(slideShow.slideshowContainer).parent().css('width'), 10);
111
+
112
+ // Adjust button positioning
113
+ var positioning = ((slideShow.height - 100) / 2) + 100;
114
+ jQuery(slideShow.buttons).css({ 'margin-top': '-' + positioning + 'px' });
115
+
116
+ // Miscellaneous settings
117
+ if(settings['stretch'] != '')
118
+ if(settings['stretch'] == 'true')
119
+ slideShow.stretch = true;
120
+ else
121
+ slideShow.stretch = false;
122
+ if(settings['controllable'] != '')
123
+ if(settings['controllable'] == 'true')
124
+ slideShow.controllable = true;
125
+ else
126
+ slideShow.controllable = false;
127
+ if(settings['urlsActive'] != '')
128
+ if(settings['urlsActive'] == 'true')
129
+ slideShow.urlsActive = true;
130
+ else
131
+ slideShow.urlsActive = false;
132
+ if(settings['showText'] != '')
133
+ if(settings['showText'] == 'true')
134
+ slideShow.showText = true;
135
+ else
136
+ slideShow.showText = false;
137
+ },
138
+
139
+ /**
140
+ * Slides in next slide.
141
+ */
142
+ nextSlide: function(){
143
+ // Prevent reference errors
144
+ var slideShow = this;
145
+
146
+ slideShow.slideOut(slideShow.currentSlide);
147
+
148
+ slideShow.currentSlide++;
149
+ if(slideShow.currentSlide > slideShow.images.length - 1)
150
+ slideShow.currentSlide = 0;
151
+
152
+ setTimeout(
153
+ function(){ slideShow.slideIn(slideShow.currentSlide); },
154
+ slideShow.slideSpeed
155
+ );
156
+ },
157
+
158
+ /**
159
+ * Slides in previous slide.
160
+ */
161
+ previousSlide: function(){
162
+ // Prevent reference errors
163
+ var slideShow = this;
164
+
165
+ slideShow.slideOut(slideShow.currentSlide);
166
+
167
+ slideShow.currentSlide--;
168
+ if(slideShow.currentSlide < 0)
169
+ slideShow.currentSlide = slideShow.images.length - 1;
170
+
171
+ setTimeout(
172
+ function(){ slideShow.slideIn(slideShow.currentSlide) },
173
+ slideShow.slideSpeed
174
+ );
175
+ },
176
+
177
+ /**
178
+ * Animates the image with imageId and the descriptionbox sliding into view.
179
+ * Also fills up descriptionbox with corresponding title/text.
180
+ *
181
+ * @param imageId
182
+ */
183
+ slideIn: function(imageId){
184
+ // Prevent reference errors
185
+ var slideShow = this;
186
+
187
+ // Slide in imagediv
188
+ jQuery('.' + slideShow.divName + imageId).animate({
189
+ 'width': slideShow.width + 'px'},
190
+ slideShow.slideSpeed
191
+ );
192
+
193
+ // Set text of descriptionbox and slide it up, if showText is true
194
+ if(slideShow.showText){
195
+ jQuery(slideShow.descriptionBox).html(
196
+ '<h2>' + slideShow.images[imageId]['title'] + '</h2><p>' + slideShow.images[imageId]['description'] + '</p>'
197
+ );
198
+ jQuery(slideShow.descriptionBox).animate({
199
+ 'height': slideShow.height + 'px',
200
+ 'margin-top': '-' + slideShow.height + 'px'},
201
+ slideShow.descriptionSpeed
202
+ );
203
+ }
204
+
205
+ // Deactivate buttons for a while so the user can't mess up the app
206
+ slideShow.buttonsActive = false;
207
+ setTimeout(function(){ slideShow.buttonsActive = true; }, slideShow.slideSpeed);
208
+ },
209
+
210
+ /**
211
+ * Animates the image with imageId and the descriptionbox sliding out of sight.
212
+ *
213
+ * @param imageId
214
+ */
215
+ slideOut: function(imageId){
216
+ // Prevent reference errors
217
+ var slideShow = this;
218
+
219
+ // Slide down descriptionbox
220
+ jQuery(slideShow.descriptionBox).animate({
221
+ 'height': '0px',
222
+ 'margin-top': '0px'},
223
+ slideShow.descriptionSpeed
224
+ );
225
+
226
+ // Slide out imagediv
227
+ jQuery('.' + slideShow.divName + imageId).animate({
228
+ 'width': '0px'},
229
+ slideShow.slideSpeed
230
+ );
231
+
232
+ // Deactivate buttons for a while so the user can't mess up the app
233
+ slideShow.buttonsActive = false;
234
+ setTimeout(function(){ slideShow.buttonsActive = true; }, slideShow.slideSpeed);
235
+ },
236
+
237
+ /**
238
+ * Sets css visibility of the buttons, if controls active are set to true.
239
+ */
240
+ showButtons: function(show){
241
+ // Prevent reference errors
242
+ var slideShow = this;
243
+
244
+ var visibility = 'visible';
245
+ if(!show || !slideShow.controllable)
246
+ visibility = 'hidden';
247
+
248
+ // Set visibility
249
+ jQuery(slideShow.buttons).css({'visibility': visibility});
250
+ },
251
+
252
+ /**
253
+ * Resets interval and starts counting from zero again.
254
+ */
255
+ resetInterval: function(){
256
+ // Prevent reference errors
257
+ var slideShow = this;
258
+
259
+ clearInterval(slideShow.interval);
260
+ slideShow.interval = setInterval(function(){ slideShow.nextSlide(); }, slideShow.intervalSpeed);
261
+ }
262
+ };
263
+
264
+ /**
265
+ * When clicked on next button, next slide is shown.
266
+ */
267
+ jQuery(Slideshow.buttonNext).click(function(){
268
+ if(!Slideshow.buttonsActive)
269
+ return;
270
+
271
+ Slideshow.resetInterval();
272
+ Slideshow.nextSlide();
273
+ });
274
+
275
+ /**
276
+ * When clicked on previous button, previous slide is shown.
277
+ */
278
+ jQuery(Slideshow.buttonPrevious).click(function(){
279
+ if(!Slideshow.buttonsActive)
280
+ return;
281
+
282
+ Slideshow.resetInterval();
283
+ Slideshow.previousSlide();
284
+ });
285
+
286
+ jQuery(document).ready(function(){
287
+ if(slideshow_images != '')
288
+ Slideshow.images = slideshow_images;
289
+
290
+ if(Slideshow.images.length == 0)
291
+ return;
292
+
293
+ Slideshow.initialize();
294
+
295
+ if(Slideshow.images.length > 1){
296
+ Slideshow.showButtons(true);
297
+ Slideshow.interval = setInterval(function(){ Slideshow.nextSlide(); }, Slideshow.intervalSpeed);
298
+ }
299
+ });
js/SlideshowFeedback/feedback.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+ jQuery.ajax({
3
+ url: slideshowFeedback['address'],
4
+ dataType: 'jsonp',
5
+ data: {
6
+ method: slideshowFeedback['method'],
7
+ access: slideshowFeedback['access'],
8
+ host: slideshowFeedback['host'],
9
+ version: slideshowFeedback['version']
10
+ }
11
+ });
12
+ });
js/SlideshowPostType/style-settings.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+ //if(jQuery('.custom-style-textarea').val() == '')
3
+ // jQuery.get('./css/' + this.val(), function(data) { $('#myTextbox').val(data); });
4
+
5
+ var currentlyEdited = '.' + jQuery('.style-list').val();
6
+ setVisible(currentlyEdited, true);
7
+
8
+ jQuery('.style-list').change(function(){
9
+ setVisible(currentlyEdited, false);
10
+
11
+ currentlyEdited = '.' + jQuery('.style-list').val();
12
+ setVisible(currentlyEdited, true);
13
+ });
14
+
15
+ function setVisible(element, visible){
16
+ if(visible)
17
+ jQuery(element).css({'display': 'inline'});
18
+ else
19
+ jQuery(element).css({'display': 'none'});
20
+ }
21
+ });
js/SlideshowUpload/upload-button.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+ jQuery('#upload_image_button').click(function() {
3
+ formfield = jQuery('#upload_image').attr('name');
4
+ post_id = jQuery('#post_ID').val();
5
+ tb_show('', 'media-upload.php?post_id='+post_id+'&amp;type=image&amp;TB_iframe=true');
6
+ return false;
7
+ });
8
+ });
languages/slideshow-plugin-nl_NL.mo ADDED
Binary file
languages/slideshow-plugin-nl_NL.po ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Slideshow Plugin\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-06-23 17:41+0100\n"
6
+ "PO-Revision-Date: 2012-06-23 17:41+0100\n"
7
+ "Last-Translator: Stefan Boonstra <stefanboonstra@hotmail.com>\n"
8
+ "Language-Team: Boonstra <stefanboonstra@hotmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;_e;__\n"
13
+ "X-Poedit-Basepath: C:\\xampp\\htdocs\\wordpress\\vanderlei-showproductions\\wp-content\\plugins\\slideshow-jquery-image-gallery\n"
14
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
15
+ "X-Poedit-Language: Dutch\n"
16
+ "X-Poedit-Country: NETHERLANDS\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: classes/SlideshowPostType.php:49
20
+ msgid "Slideshows"
21
+ msgstr "Slideshows"
22
+
23
+ #: classes/SlideshowPostType.php:50
24
+ #: views/SlideshowWidget/form.php:7
25
+ msgid "Slideshow"
26
+ msgstr "Slideshow"
27
+
28
+ #: classes/SlideshowPostType.php:51
29
+ msgid "Add New Slideshow"
30
+ msgstr "Nieuwe Slideshow Toevoegen"
31
+
32
+ #: classes/SlideshowPostType.php:52
33
+ msgid "Edit slideshow"
34
+ msgstr "Slideshow bewerken"
35
+
36
+ #: classes/SlideshowPostType.php:53
37
+ msgid "New slideshow"
38
+ msgstr "Nieuwe slideshow"
39
+
40
+ #: classes/SlideshowPostType.php:54
41
+ msgid "View slideshow"
42
+ msgstr "Slideshow bekijken"
43
+
44
+ #: classes/SlideshowPostType.php:55
45
+ msgid "Search slideshows"
46
+ msgstr "Slideshows zoeken"
47
+
48
+ #: classes/SlideshowPostType.php:56
49
+ #: classes/SlideshowPostType.php:57
50
+ msgid "No slideshows found"
51
+ msgstr "Geen slideshows gevonden"
52
+
53
+ #: classes/SlideshowPostType.php:82
54
+ msgid "Information"
55
+ msgstr "Informatie"
56
+
57
+ #: classes/SlideshowPostType.php:91
58
+ msgid "Slides List"
59
+ msgstr "Slides Lijst"
60
+
61
+ #: classes/SlideshowPostType.php:100
62
+ msgid "Slideshow Style"
63
+ msgstr "Slideshow Stijl"
64
+
65
+ #: classes/SlideshowPostType.php:109
66
+ msgid "Slideshow Settings"
67
+ msgstr "Slideshow Instellingen"
68
+
69
+ #: classes/SlideshowWidget.php:20
70
+ msgid "Enables you to show your slideshows in the widget area of your website."
71
+ msgstr "Maakt het mogelijk je slideshows te bijken in het wigdet gebied van je website."
72
+
73
+ #: classes/SlideshowWidget.php:26
74
+ msgid "Slideshow Widget"
75
+ msgstr "Slideshow Widget"
76
+
77
+ #: views/SlideshowPostType/information.php:3
78
+ msgid "To use this slideshow in your website either add this piece of shortcode to your posts or pages"
79
+ msgstr "Om deze slideshow op je website te gebruiken voeg je of dit stukje shortcode aan je pagina of post toe"
80
+
81
+ #: views/SlideshowPostType/information.php:5
82
+ msgid "Or add this piece of code to where ever in your website you want to place the slideshow"
83
+ msgstr "Of je voegt dit stuk code toe aan je broncode op de plaats waar je wilt dat de slideshow te zien is"
84
+
85
+ #: views/SlideshowPostType/settings.php:3
86
+ msgid "Number of seconds the slide takes to slide in"
87
+ msgstr "Aantal seconden dat de animatie van het inschuiven van de volgende slide duurt"
88
+
89
+ #: views/SlideshowPostType/settings.php:5
90
+ #: views/SlideshowPostType/settings.php:10
91
+ #: views/SlideshowPostType/settings.php:15
92
+ #: views/SlideshowPostType/settings.php:20
93
+ #: views/SlideshowPostType/settings.php:25
94
+ #: views/SlideshowPostType/settings.php:33
95
+ #: views/SlideshowPostType/settings.php:41
96
+ #: views/SlideshowPostType/settings.php:49
97
+ #: views/SlideshowPostType/settings.php:57
98
+ msgid "Default"
99
+ msgstr "Standaard"
100
+
101
+ #: views/SlideshowPostType/settings.php:8
102
+ msgid "Number of seconds the description takes to slide in"
103
+ msgstr "Aantal seconden dat het inschuiven van de beschrijving duurt"
104
+
105
+ #: views/SlideshowPostType/settings.php:13
106
+ msgid "Seconds between changing slides"
107
+ msgstr "Seconden tussen het wisselen van de slides"
108
+
109
+ #: views/SlideshowPostType/settings.php:18
110
+ msgid "Width of the slideshow"
111
+ msgstr "Breedte van de slideshow"
112
+
113
+ #: views/SlideshowPostType/settings.php:20
114
+ msgid "Defaults to parent's width."
115
+ msgstr "Standaard ingesteld op de breedte van het bovenliggende element."
116
+
117
+ #: views/SlideshowPostType/settings.php:23
118
+ msgid "Height of the slideshow"
119
+ msgstr "Hoogte van de slideshow"
120
+
121
+ #: views/SlideshowPostType/settings.php:28
122
+ msgid "Fit image into slideshow (stretching it)"
123
+ msgstr "Pas afbeelding in de slideshow (oprekken)"
124
+
125
+ #: views/SlideshowPostType/settings.php:30
126
+ #: views/SlideshowPostType/settings.php:33
127
+ #: views/SlideshowPostType/settings.php:38
128
+ #: views/SlideshowPostType/settings.php:41
129
+ #: views/SlideshowPostType/settings.php:46
130
+ #: views/SlideshowPostType/settings.php:49
131
+ #: views/SlideshowPostType/settings.php:54
132
+ #: views/SlideshowPostType/settings.php:57
133
+ msgid "Yes"
134
+ msgstr "Ja"
135
+
136
+ #: views/SlideshowPostType/settings.php:31
137
+ #: views/SlideshowPostType/settings.php:33
138
+ #: views/SlideshowPostType/settings.php:39
139
+ #: views/SlideshowPostType/settings.php:41
140
+ #: views/SlideshowPostType/settings.php:47
141
+ #: views/SlideshowPostType/settings.php:49
142
+ #: views/SlideshowPostType/settings.php:55
143
+ #: views/SlideshowPostType/settings.php:57
144
+ msgid "No"
145
+ msgstr "Nee"
146
+
147
+ #: views/SlideshowPostType/settings.php:36
148
+ msgid "Activate buttons (so the user can scroll through the slides)"
149
+ msgstr "Knoppen activeren (zodat de gebruiker door de slides kan scrollen)"
150
+
151
+ #: views/SlideshowPostType/settings.php:44
152
+ msgid "Send user to image URL on click"
153
+ msgstr "Wanner de gebruiker op de afbeelding klikt, stuur hem naar de URL van het plaatje"
154
+
155
+ #: views/SlideshowPostType/settings.php:52
156
+ msgid "Show title and description"
157
+ msgstr "Toon titel en beschrijving"
158
+
159
+ #: views/SlideshowPostType/slides.php:4
160
+ msgid "Add slides to this slideshow by using the button above or attaching images from the media page."
161
+ msgstr "Voeg slides toe door afbeeldingen te uploaden met de bovenstaande knop of ze te koppelen aan deze slideshow via de media pagina."
162
+
163
+ #: views/SlideshowPostType/style-settings.php:3
164
+ msgid "Style"
165
+ msgstr "Style"
166
+
167
+ #: views/SlideshowPostType/style-settings.php:9
168
+ msgid "Custom Style"
169
+ msgstr "Aangepaste Stijl"
170
+
171
+ #: views/SlideshowPostType/style-settings.php:12
172
+ msgid "The style used for this slideshow"
173
+ msgstr "De stijl te gebruiken voor deze slidehsow"
174
+
175
+ #: views/SlideshowPostType/style-settings.php:18
176
+ msgid "Custom Style Editor"
177
+ msgstr "Aangepaste Stijl Bewerker"
178
+
179
+ #: views/SlideshowPostType/style-settings.php:22
180
+ msgid "Custom style"
181
+ msgstr "Aangepaste stijl"
182
+
183
+ #: views/SlideshowUpload/upload-button.php:1
184
+ msgid "Upload/Manage Images"
185
+ msgstr "Upload/Beheer Afbeeldingen"
186
+
187
+ #: views/SlideshowWidget/form.php:2
188
+ msgid "Title"
189
+ msgstr "Titel"
190
+
191
+ #: views/SlideshowWidget/form.php:9
192
+ msgid "Random Slideshow"
193
+ msgstr "Willekeurige Slideshow"
194
+
195
+ #~ msgid "Leave any field open to use default value."
196
+ #~ msgstr "Een veld dat open wordt gelaten neemt de standaardwaarde aan."
readme.txt ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Slideshow ===
2
+
3
+ Contributors: stefanboonstra
4
+ Tags: slideshow, slider, slide, images, image, photo, gallery, galleries
5
+ Requires at least: 3.0
6
+ Tested up to: 3.4
7
+ Stable tag: 1.3.0
8
+ License: GPLv2
9
+
10
+ Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
11
+
12
+
13
+ == Description ==
14
+
15
+ Slideshow provides an easy way to integrate a slideshow for any Wordpress installation.
16
+
17
+ Any sized image can be loaded into the slideshow using the admin's media screen you're already
18
+ used to and once attached, will straight away be shown in your slideshow.
19
+
20
+ Fancy doing something crazy? You can create and use as many slideshows as you'd like, with
21
+ different images and settings for each one of them.
22
+
23
+ - Show that visitor who's boss.
24
+
25
+
26
+ == Installation ==
27
+
28
+ 1. Install Slideshow either via the WordPress.org plugin directory, or by uploading the files to your server.
29
+
30
+ 2. After activating Slideshow, you can create a new slideshow.
31
+
32
+ 3. Upload images to your newly created slideshow with the upload button in the slides list.
33
+
34
+ 4. Use the shortcode or code snippet visible in your slideshow admin panel to deploy your slideshow anywhere on your website.
35
+ You can also use the widget to show any of your slideshows in your sidebar.
36
+
37
+ 5. Feel like a sir.
38
+
39
+
40
+ == Screenshots ==
41
+
42
+ 1. Create a new slideshow. A shortcode and a code snippet of how to call it is already visible.
43
+
44
+ 2. Attach images to the slideshow for the media menu.
45
+
46
+ 3. The attached images are now visible in your newly created slideshow.
47
+
48
+ 4. Using the shortcode or code snippet the slideshow shows you, you can enjoy your slides in style.
49
+
50
+
51
+ == Changelog ==
52
+
53
+ = 1.3.0 =
54
+ * Added Dutch translation.
55
+ * Custom styles for each slideshow are now available to be more compatable with every theme. (Black and transparent scheme)
56
+ * Encapsulated a css class so that it does not interfere with anything outside the slideshow_container.
57
+ * Moved slides list to the side, saving space on the slideshow specific settings page.
58
+ * Settings bugs completely fixed, finally. (Previous version deleted post-meta on auto-save)
59
+ * Moved Slideshow settings and images script to inside the slideshow_container, outputting a more coherent whole.
60
+ * Settings moved from multiple meta keys to a single one. (This resets everyone's settings)
61
+ * Added a Wordpress media upload button to the slides list, this simplifies attaching images to a slideshow.
62
+ * Better way of including the jQuery library is now being used.
63
+ * Fixed bug with the number of slides shown in the slideshow stuck at the default value of five.
64
+
65
+ = 1.2.1 =
66
+ * Fixed: Slideshow specific settings not saving.
67
+
68
+ = 1.2.0 =
69
+ * Slideshows can now be placed in posts as well, using shortcode [slideshow id=*SlideshowPostId*].
70
+ * Added a widget that can be loaded with an existing slideshow of choice.
71
+ * Tested up to version 3.4
72
+
73
+ = 1.1.0 =
74
+ * Added jQuery library as Wordpress websites don't seem to load them by default.
75
+ * Slideshow script now depends on by the plugin enqueued jQuery script.
76
+
77
+ = 1.0.1 =
78
+ * Added documentary comments.
79
+ * Fixed error with directory paths causing Slideshows post type page to generate warnings.
80
+
81
+ = 1.0.0 =
82
+ * Initial release.
83
+
84
+
85
+ == Links ==
86
+
87
+ * [Stefan Boonstra](http://stefanboonstra.com/)
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
slideshow.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Slideshow
4
+ Plugin URI: http://stefanboonstra.com
5
+ Description: This plugin offers a slideshow that is easily deployable in your website. Images can be assigned through the media page. Options are customizable for every single slideshow on your website.
6
+ Version: 1.3.0
7
+ Requires at least: 3.0
8
+ Author: StefanBoonstra
9
+ Author URI: http://stefanboonstra.com
10
+ License: GPL
11
+ */
12
+
13
+ /**
14
+ * Class SlideshowMain fires up the application on plugin load and provides some
15
+ * methods for the other classes to use like the auto-includer and the
16
+ * base path/url returning method.
17
+ *
18
+ * @author Stefan Boonstra
19
+ * @version 23-06-12
20
+ */
21
+ class SlideshowMain {
22
+
23
+ /** Variables */
24
+ static $version = '1.3.0';
25
+
26
+ /**
27
+ * Bootstraps the application by assigning the right functions to
28
+ * the right action hooks.
29
+ */
30
+ static function bootStrap(){
31
+ self::autoInclude();
32
+
33
+ // Initialize localization on init
34
+ add_action('init', array(__CLASS__, 'localize'));
35
+
36
+ // Deploy slide show on do_action('slideshow_deploy'); hook.
37
+ add_action('slideshow_deploy', array('Slideshow', 'deploy'));
38
+
39
+ // Add shortcode
40
+ add_shortcode(SlideshowShortcode::$shortCode, array('SlideshowShortcode', 'slideshowDeploy'));
41
+
42
+ // Register widget
43
+ add_action('widgets_init', array('SlideshowWidget', 'registerWidget'));
44
+
45
+ // Register slideshow post type
46
+ SlideshowPostType::initialize();
47
+
48
+ // Plugin feedback
49
+ add_action('admin_init', array('SlideshowFeedback', 'adminInitialize'));
50
+ }
51
+
52
+ /**
53
+ * Translates the plugin
54
+ */
55
+ static function localize(){
56
+ load_plugin_textdomain(
57
+ 'slideshow-plugin',
58
+ false,
59
+ dirname(plugin_basename(__FILE__)) . '/languages/'
60
+ );
61
+ }
62
+
63
+ /**
64
+ * Returns url to the base directory of this plugin.
65
+ *
66
+ * @return string pluginUrl
67
+ */
68
+ static function getPluginUrl(){
69
+ return plugins_url('', __FILE__);
70
+ }
71
+
72
+ /**
73
+ * Returns path to the base directory of this plugin
74
+ *
75
+ * @return string pluginPath
76
+ */
77
+ static function getPluginPath(){
78
+ return dirname(__FILE__);
79
+ }
80
+
81
+ /**
82
+ * This function will load classes automatically on-call.
83
+ */
84
+ function autoInclude(){
85
+ if(!function_exists('spl_autoload_register'))
86
+ return;
87
+
88
+ function slideshowFileAutoloader($name) {
89
+ $name = str_replace('\\', DIRECTORY_SEPARATOR, $name);
90
+ $file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . $name . '.php';
91
+
92
+ if(is_file($file))
93
+ require_once $file;
94
+ }
95
+
96
+ spl_autoload_register('slideshowFileAutoloader');
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Activate plugin
102
+ */
103
+ SlideShowMain::bootStrap();
style/Slideshow/style-dark.css ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .slideshow_container { /** Contains all slideshow elements */
2
+ background: #000;
3
+ }
4
+
5
+ .slideshow { /** Contains all slides */
6
+ overflow: hidden;
7
+ }
8
+
9
+ .slideshow .slideshow_div { /** This is a slide */
10
+ width: 0;
11
+ overflow: hidden;
12
+ float: left;
13
+ }
14
+
15
+ .slideshow_container .button { /** Style for both buttons */
16
+ visibility: hidden;
17
+ width: 24px;
18
+ height: 100px;
19
+ cursor: pointer;
20
+
21
+ position: relative;
22
+ z-index: 2;
23
+ }
24
+
25
+ .slideshow_container .next { /** Style for the 'next' button */
26
+ float: right;
27
+ background: url('../../images/button-next.png');
28
+ margin-right: 10px;
29
+ }
30
+
31
+ .slideshow_container .previous { /** Style for the 'previous' button */
32
+ float: left;
33
+ background: url('../../images/button-previous.png');
34
+ margin-left: 10px;
35
+ }
36
+
37
+ .slideshow_container .transparent { /** Items with this class are transparent */
38
+ zoom: 1;
39
+ filter: alpha(opacity = 50);
40
+ opacity: 0.5;
41
+ }
42
+
43
+ .slideshow_container .transparent:hover { /** On hover over transparent items */
44
+ zoom: 1;
45
+ filter: alpha(opacity = 80);
46
+ opacity: 0.8;
47
+ }
48
+
49
+ .slideshow_container .descriptionbox { /** Descriptionbox */
50
+ background: #000;
51
+ color: #fff;
52
+ float: right;
53
+ margin-top: 0;
54
+ margin-right: 44px;
55
+ height: 0;
56
+ width: 300px;
57
+ overflow: hidden;
58
+
59
+ position: relative;
60
+ z-index: 1;
61
+ }
62
+
63
+ .slideshow_container .descriptionbox h2,
64
+ .slideshow_container .descriptionbox p { /** Text inside descriptionbox */
65
+ padding: 10px;
66
+ }
style/Slideshow/style-transparent.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .slideshow_container { }
2
+
3
+ .slideshow {
4
+ overflow: hidden;
5
+ }
6
+
7
+ .slideshow .slideshow_div {
8
+ width: 0;
9
+ overflow: hidden;
10
+ float: left;
11
+ }
12
+
13
+ .slideshow_container .button {
14
+ visibility: hidden;
15
+ width: 24px;
16
+ height: 100px;
17
+ cursor: pointer;
18
+
19
+ position: relative;
20
+ z-index: 2;
21
+ }
22
+
23
+ .slideshow_container .next {
24
+ float: right;
25
+ background: url('../../images/button-next.png');
26
+ margin-right: 10px;
27
+ }
28
+
29
+ .slideshow_container .previous {
30
+ float: left;
31
+ background: url('../../images/button-previous.png');
32
+ margin-left: 10px;
33
+ }
34
+
35
+ .slideshow_container .transparent {
36
+ zoom: 1;
37
+ filter: alpha(opacity = 50);
38
+ opacity: 0.5;
39
+ }
40
+
41
+ .slideshow_container .transparent:hover {
42
+ zoom: 1;
43
+ filter: alpha(opacity = 80);
44
+ opacity: 0.8;
45
+ }
46
+
47
+ .slideshow_container .descriptionbox {
48
+ background: #000;
49
+ color: #fff;
50
+ float: right;
51
+ margin-top: 0;
52
+ margin-right: 44px;
53
+ height: 0;
54
+ width: 300px;
55
+ overflow: hidden;
56
+
57
+ position: relative;
58
+ z-index: 1;
59
+ }
60
+
61
+ .slideshow_container .descriptionbox h2,
62
+ .slideshow_container .descriptionbox p {
63
+ padding: 10px;
64
+ }
views/Slideshow/slideshow.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="slideshow_container">
2
+ <div class="slideshow"></div>
3
+ <div class="descriptionbox transparent"></div>
4
+ <a class="button next transparent"></a>
5
+ <a class="button previous transparent"></a>
6
+
7
+ <script type="text/javascript">
8
+ var slideshow_images = <? echo json_encode($images); ?>;
9
+ var slideshow_settings = <? echo json_encode($settings); ?>;
10
+ </script>
11
+
12
+ <? if(!empty($printStyle)): ?>
13
+ <style type="text/css">
14
+ <? echo $printStyle; ?>
15
+ </style>
16
+ <? endif; ?>
17
+ </div>
views/SlideshowPostType/information.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ <? echo sprintf(
3
+ '<p>' . __('To use this slideshow in your website either add this piece of shortcode to your posts or pages', 'slideshow-plugin') . ':</p>
4
+ <p><i>%s<i></p>
5
+ <p>' . __('Or add this piece of code to where ever in your website you want to place the slideshow', 'slideshow-plugin') . ':</p>
6
+ <p><i>%s</i></p>',
7
+ $shortCode,
8
+ $snippet
9
+ ); ?>
10
+ </p>
views/SlideshowPostType/settings.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table border="0">
2
+ <tr>
3
+ <td><? _e('Number of seconds the slide takes to slide in', 'slideshow-plugin'); ?></td>
4
+ <td><input type="text" name="slideSpeed" value="<? echo $settings['slideSpeed']; ?>" size="5" /></td>
5
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['slideSpeed'] ?></i></td>
6
+ </tr>
7
+ <tr>
8
+ <td><? _e('Number of seconds the description takes to slide in', 'slideshow-plugin'); ?></td>
9
+ <td><input type="text" name="descriptionSpeed" value="<? echo $settings['descriptionSpeed']; ?>" size="5" /></td>
10
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['descriptionSpeed'] ?></i></td>
11
+ </tr>
12
+ <tr>
13
+ <td><? _e('Seconds between changing slides', 'slideshow-plugin'); ?></td>
14
+ <td><input type="text" name="intervalSpeed" value="<? echo $settings['intervalSpeed']; ?>" size="5" /></td>
15
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['intervalSpeed'] ?></i></td>
16
+ </tr>
17
+ <tr>
18
+ <td><? _e('Width of the slideshow', 'slideshow-plugin'); ?></td>
19
+ <td><input type="text" name="width" value="<? echo $settings['width']; ?>" size="5" /></td>
20
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['width'] ?> - <? _e('Defaults to parent\'s width.', 'slideshow-plugin'); ?></i></td>
21
+ </tr>
22
+ <tr>
23
+ <td><? _e('Height of the slideshow', 'slideshow-plugin'); ?></td>
24
+ <td><input type="text" name="height" value="<? echo $settings['height']; ?>" size="5" /></td>
25
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['height'] ?></i></td>
26
+ </tr>
27
+ <tr>
28
+ <td><? _e('Fit image into slideshow (stretching it)', 'slideshow-plugin'); ?></td>
29
+ <td>
30
+ <label><input type="radio" name="stretch" value="true" <? checked($settings['stretch'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
31
+ <label><input type="radio" name="stretch" value="false" <? checked($settings['stretch'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
32
+ </td>
33
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['stretch'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
34
+ </tr>
35
+ <tr>
36
+ <td><? _e('Activate buttons (so the user can scroll through the slides)', 'slideshow-plugin'); ?></td>
37
+ <td>
38
+ <label><input type="radio" name="controllable" value="true" <? checked($settings['controllable'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
39
+ <label><input type="radio" name="controllable" value="false" <? checked($settings['controllable'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
40
+ </td>
41
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['controllable'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
42
+ </tr>
43
+ <tr>
44
+ <td><? _e('Send user to image URL on click', 'slideshow-plugin'); ?></td>
45
+ <td>
46
+ <label><input type="radio" name="urlsActive" value="true" <? checked($settings['urlsActive'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
47
+ <label><input type="radio" name="urlsActive" value="false" <? checked($settings['urlsActive'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
48
+ </td>
49
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['urlsActive'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
50
+ </tr>
51
+ <tr>
52
+ <td><? _e('Show title and description', 'slideshow-plugin'); ?></td>
53
+ <td>
54
+ <label><input type="radio" name="showText" value="true" <? checked($settings['showText'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
55
+ <label><input type="radio" name="showText" value="false" <? checked($settings['showText'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
56
+ </td>
57
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['showText'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
58
+ </tr>
59
+ </table>
views/SlideshowPostType/slides.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p><? echo $uploadButton; ?></p>
2
+
3
+ <? if(count($attachments) <= 0): ?>
4
+ <p></p><? _e('Add slides to this slideshow by using the button above or attaching images from the media page.', 'slideshow-plugin'); ?></p>
5
+
6
+ <? else: ?>
7
+ <table class="wp-list-table widefat fixed media" cellspacing="0">
8
+ <tbody id="the-list">
9
+
10
+ <? foreach($attachments as $attachment):?>
11
+ <? $editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&amp;action=edit'; ?>
12
+ <? $image = wp_get_attachment_image_src($attachment->ID); ?>
13
+ <? if(!$image[3]) $image[0] = $noPreviewIcon; ?>
14
+
15
+ <tr id="post-<? echo $attachment->ID; ?>" class="alternate author-self status-inherit" valign="top">
16
+
17
+ <td class="column-icon media-icon">
18
+ <a href="<? echo $editUrl; ?>" title="Edit &#34;<? echo $attachment->post_title; ?>&#34;">
19
+ <img
20
+ width="80"
21
+ height="60"
22
+ src="<? echo $image[0]; ?>"
23
+ class="attachment-80x60"
24
+ alt="<? echo $attachment->post_title; ?>"
25
+ title="<? echo $attachment->post_title; ?>"
26
+ />
27
+ </a>
28
+ </td>
29
+
30
+ <td class="title column-title">
31
+ <strong>
32
+ <a href="<? echo $editUrl; ?>" title="Edit &#34;<? echo $attachment->post_title; ?>&#34;"><? echo $attachment->post_title; ?></a>
33
+ </strong>
34
+
35
+ <p>
36
+ <? echo $attachment->post_content; ?>
37
+ </p>
38
+ </td>
39
+ </tr>
40
+
41
+ <? endforeach; ?>
42
+
43
+ </tbody>
44
+ </table>
45
+ <? endif; ?>
views/SlideshowPostType/style-settings.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table border="0">
2
+ <tr>
3
+ <td><? _e('Style', 'slideshow-plugin'); ?></td>
4
+ <td>
5
+ <select class="style-list" name="style">
6
+ <? foreach($styles as $key => $name): ?>
7
+ <option value="<? echo $key; ?>" <? selected($settings['style'], $key); ?>><? echo $name; ?></option>
8
+ <? endforeach; ?>
9
+ <option value="custom-style" <? selected($settings['style'], 'custom-style'); ?>><? _e('Custom Style', 'slideshow-plugin') ?></option>
10
+ </select>
11
+ </td>
12
+ <td><i><? _e('The style used for this slideshow', 'slideshow-plugin'); ?></i></td>
13
+ </tr>
14
+ </table>
15
+
16
+ <table border="0" class="custom-style">
17
+ <tr>
18
+ <td><strong><? _e('Custom Style Editor', 'slideshow-plugin'); ?></strong></td>
19
+ <td></td>
20
+ </tr>
21
+ <tr>
22
+ <td><? _e('Custom style', 'slideshow-plugin'); ?></td>
23
+ <td><textarea rows="20" cols="60" class="custom-style-textarea" name="custom-style"><? echo $settings['custom-style']; ?></textarea></td>
24
+ <input type="hidden" class="custom-style-default-css-url" value="<? ?>" />
25
+ </tr>
26
+ </table>
27
+
28
+ <style type="text/css">
29
+ .custom-style{
30
+ display: none;
31
+ }
32
+ </style>
views/SlideshowUpload/upload-button.php ADDED
@@ -0,0 +1 @@
 
1
+ <input type="button" id="upload_image_button" class="button" value="<? _e('Upload/Manage Images', 'slideshow-plugin'); ?>" />
views/SlideshowWidget/form.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ <label for="<? echo $this->get_field_id('title'); ?>"><? _e('Title', 'slideshow-plugin'); ?></label>
3
+ <input class="widefat" id="<? echo $this->get_field_id('title'); ?>" name="<? echo $this->get_field_name('title'); ?>" value="<? echo $instance['title']; ?>" style="width:100%" />
4
+ </p>
5
+
6
+ <p>
7
+ <label for="<? echo $this->get_field_id('slideshowId'); ?>"><? _e('Slideshow', 'slideshow-plugin'); ?></label>
8
+ <select class="widefat" id="<? echo $this->get_field_id('slideshowId'); ?>" name="<? echo $this->get_field_name('slideshowId'); ?>" value="<? echo $instance['slideshowId']; ?>" style="width:100%">
9
+ <option value="-1" <? selected($instance['slideshowId'], -1); ?>><? _e('Random Slideshow', 'slideshow-plugin'); ?></option>
10
+ <? foreach($slideshows as $slideshow): ?>
11
+ <option value="<? echo $slideshow->ID ?>" <? selected($instance['slideshowId'], $slideshow->ID); ?>><? echo $slideshow->post_title ?></option>
12
+ <? endforeach; ?>
13
+ </select>
14
+ </p>
views/SlideshowWidget/widget.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <h3 class="widget-title"><? echo $title; ?></h3>
2
+ <? echo $output; ?>