Slideshow Gallery - Version 1.6.1

Version Description

  • IMPROVE: Featured posts in TinyMCE button/icon dialog
  • IMPROVE: No items tables in admin sections
  • FIX: Possible security vulnerability with malicious strings in slides/galleries
Download this release

Release Info

Developer contrid
Plugin Icon 128x128 Slideshow Gallery
Version 1.6.1
Comparing to
See all releases

Code changes from version 1.6 to 1.6.1

js/tinymce/editor_plugin.js CHANGED
@@ -22,7 +22,7 @@
22
 
23
  // Register example button
24
  ed.addButton('gallery', {
25
- title : 'gallery.desc',
26
  cmd : 'mcegallery',
27
  });
28
  },
22
 
23
  // Register example button
24
  ed.addButton('gallery', {
25
+ title : 'Insert a Slideshow Gallery',
26
  cmd : 'mcegallery',
27
  });
28
  },
models/gallery.php CHANGED
@@ -27,7 +27,7 @@ class GalleryGallery extends GalleryDbHelper {
27
 
28
  if (!empty($data)) {
29
  foreach ($data as $dkey => $dval) {
30
- $this -> {$dkey} = stripslashes_deep($dval);
31
 
32
  switch ($dkey) {
33
  case 'id' :
27
 
28
  if (!empty($data)) {
29
  foreach ($data as $dkey => $dval) {
30
+ $this -> {$dkey} = esc_attr(stripslashes_deep($dval));
31
 
32
  switch ($dkey) {
33
  case 'id' :
models/slide.php CHANGED
@@ -40,7 +40,7 @@ class GallerySlide extends GalleryDbHelper {
40
 
41
  if (!empty($data)) {
42
  foreach ($data as $dkey => $dval) {
43
- $this -> {$dkey} = stripslashes_deep($dval);
44
 
45
  switch ($dkey) {
46
  case 'id' :
40
 
41
  if (!empty($data)) {
42
  foreach ($data as $dkey => $dval) {
43
+ $this -> {$dkey} = esc_attr(stripslashes_deep($dval));
44
 
45
  switch ($dkey) {
46
  case 'id' :
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
  Tested up to: 4.4
7
- Stable tag: 1.6
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
@@ -175,6 +175,11 @@ There is an "Images Tester" utility under Slideshow > Configuration on the right
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
178
  = 1.6 =
179
  * ADD: Excerpt length and more settings for featured posts in slideshow
180
  * ADD: Assign/set/remove galleries bulk action for slides in admin
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
  Tested up to: 4.4
7
+ Stable tag: 1.6.1
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
175
 
176
  == Changelog ==
177
 
178
+ = 1.6.1 =
179
+ * IMPROVE: Featured posts in TinyMCE button/icon dialog
180
+ * IMPROVE: No items tables in admin sections
181
+ * FIX: Possible security vulnerability with malicious strings in slides/galleries
182
+
183
  = 1.6 =
184
  * ADD: Excerpt length and more settings for featured posts in slideshow
185
  * ADD: Assign/set/remove galleries bulk action for slides in admin
slideshow-gallery-plugin.php CHANGED
@@ -4,7 +4,7 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryPlugin extends GalleryCheckinit {
6
 
7
- var $version = '1.6';
8
  var $plugin_name;
9
  var $plugin_base;
10
  var $pre = 'Gallery';
@@ -299,11 +299,10 @@ class GalleryPlugin extends GalleryCheckinit {
299
  $version = "1.5.3";
300
  }
301
 
302
- if (version_compare($cur_version, "1.6") < 0) {
303
-
304
  $this -> initialize_options();
305
 
306
- $version = "1.6";
307
  }
308
 
309
  //the current version is older.
4
 
5
  class GalleryPlugin extends GalleryCheckinit {
6
 
7
+ var $version = '1.6.1';
8
  var $plugin_name;
9
  var $plugin_base;
10
  var $pre = 'Gallery';
299
  $version = "1.5.3";
300
  }
301
 
302
+ if (version_compare($cur_version, "1.6.1") < 0) {
 
303
  $this -> initialize_options();
304
 
305
+ $version = "1.6.1";
306
  }
307
 
308
  //the current version is older.
slideshow-gallery.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://tribulant.com/plugins/view/13/wordpress-slideshow-gallery
6
  Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[tribulant_slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
- Version: 1.6
10
  License: GNU General Public License v2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
@@ -409,7 +409,15 @@ if (!class_exists('Gallery')) {
409
  }
410
  }
411
 
412
- $content = $this -> render('gallery', array('slides' => $products, 'unique' => 'products' . $productstype . $productsnumber, 'products' => true, 'options' => $s, 'frompost' => false), false, 'default');
 
 
 
 
 
 
 
 
413
  } else {
414
  $error = sprintf(__('You need the %sShopping Cart plugin%s to display products slides.', $this -> plugin_name), '<a href="http://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" target="_blank">', '</a>');
415
  }
@@ -431,7 +439,12 @@ if (!class_exists('Gallery')) {
431
  'order' => $orderd,
432
  );
433
 
434
- if ($posts = get_posts($args)) {
 
 
 
 
 
435
  $content = $this -> render('gallery', array('slides' => $posts, 'unique' => 'featured' . $featuredtype . $featurednumber, 'featured' => true, 'options' => $s, 'frompost' => false), false, 'default');
436
  } else {
437
  $error = sprintf(__('No posts with featured images are available. Ensure your theme includes %s support.', $this -> plugin_name), '<code>add_theme_support("post-thumbnails");</code>');
@@ -468,11 +481,14 @@ if (!class_exists('Gallery')) {
468
  $imagespath = $this -> get_option('imagespath');
469
 
470
  foreach ($slides as $skey => $slide) {
 
471
  $slides[$skey] -> image_path = $this -> Html -> image_path($slide);
472
  }
473
 
474
  if ($orderby == "random") { shuffle($slides); }
475
  $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'gallery' . $gallery_id . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
 
 
476
  }
477
  // All slides
478
  } elseif (!empty($custom) || empty($post_id)) {
@@ -486,6 +502,8 @@ if (!class_exists('Gallery')) {
486
  $exclude = array_map('trim', explode(',', $exclude));
487
 
488
  foreach ($slides as $slide_key => $slide) {
 
 
489
  if (in_array($slide -> id, $exclude)) {
490
  unset($slides[$slide_key]);
491
  }
@@ -493,7 +511,12 @@ if (!class_exists('Gallery')) {
493
  }
494
 
495
  if ($orderby == "random") { shuffle($slides); }
496
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => "custom", 'options' => $s, 'frompost' => false), false, 'default');
 
 
 
 
 
497
  // Images of a post/page
498
  } else {
499
  global $post;
@@ -520,6 +543,7 @@ if (!class_exists('Gallery')) {
520
 
521
  $a = 0;
522
  foreach ($attachments as $id => $attachment) {
 
523
 
524
  $a++;
525
  if (in_array($a, $exclude)) {
@@ -530,7 +554,11 @@ if (!class_exists('Gallery')) {
530
 
531
  if ($orderby == "random") { shuffle($attachments); }
532
  $content = $this -> render('gallery', array('slides' => $attachments, 'unique' => $pid, 'options' => $s, 'frompost' => true), false, 'default');
 
 
533
  }
 
 
534
  }
535
  }
536
 
6
  Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[tribulant_slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
+ Version: 1.6.1
10
  License: GNU General Public License v2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
409
  }
410
  }
411
 
412
+ if (!empty($products)) {
413
+ foreach ($products as $pkey => $product) {
414
+ $products[$pkey] = (object) array_map('esc_attr', (array) $product);
415
+ }
416
+
417
+ $content = $this -> render('gallery', array('slides' => $products, 'unique' => 'products' . $productstype . $productsnumber, 'products' => true, 'options' => $s, 'frompost' => false), false, 'default');
418
+ } else {
419
+ $error = __('No products are available', $this -> plugin_name);
420
+ }
421
  } else {
422
  $error = sprintf(__('You need the %sShopping Cart plugin%s to display products slides.', $this -> plugin_name), '<a href="http://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" target="_blank">', '</a>');
423
  }
439
  'order' => $orderd,
440
  );
441
 
442
+ if ($posts = get_posts($args)) {
443
+
444
+ foreach ($posts as $pkey => $post) {
445
+ $posts[$pkey] = (object) array_map('esc_attr', (array) $post);
446
+ }
447
+
448
  $content = $this -> render('gallery', array('slides' => $posts, 'unique' => 'featured' . $featuredtype . $featurednumber, 'featured' => true, 'options' => $s, 'frompost' => false), false, 'default');
449
  } else {
450
  $error = sprintf(__('No posts with featured images are available. Ensure your theme includes %s support.', $this -> plugin_name), '<code>add_theme_support("post-thumbnails");</code>');
481
  $imagespath = $this -> get_option('imagespath');
482
 
483
  foreach ($slides as $skey => $slide) {
484
+ $slides[$skey] = (object) array_map('esc_attr', (array) $slide);
485
  $slides[$skey] -> image_path = $this -> Html -> image_path($slide);
486
  }
487
 
488
  if ($orderby == "random") { shuffle($slides); }
489
  $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'gallery' . $gallery_id . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
490
+ } else {
491
+ $error = __('No slides are available in this gallery', $this -> plugin_name);
492
  }
493
  // All slides
494
  } elseif (!empty($custom) || empty($post_id)) {
502
  $exclude = array_map('trim', explode(',', $exclude));
503
 
504
  foreach ($slides as $slide_key => $slide) {
505
+ $slides[$slide_key] = (object) array_map('esc_attr', (array) $slide);
506
+
507
  if (in_array($slide -> id, $exclude)) {
508
  unset($slides[$slide_key]);
509
  }
511
  }
512
 
513
  if ($orderby == "random") { shuffle($slides); }
514
+
515
+ if (!empty($slides)) {
516
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => "custom", 'options' => $s, 'frompost' => false), false, 'default');
517
+ } else {
518
+ $error = __('No slides are available', $this -> plugin_name);
519
+ }
520
  // Images of a post/page
521
  } else {
522
  global $post;
543
 
544
  $a = 0;
545
  foreach ($attachments as $id => $attachment) {
546
+ $attachments[$id] = (object) array_map('esc_attr', (array) $attachment);
547
 
548
  $a++;
549
  if (in_array($a, $exclude)) {
554
 
555
  if ($orderby == "random") { shuffle($attachments); }
556
  $content = $this -> render('gallery', array('slides' => $attachments, 'unique' => $pid, 'options' => $s, 'frompost' => true), false, 'default');
557
+ } else {
558
+ $error = __('No attachments on this post/page', $this -> plugin_name);
559
  }
560
+ } else {
561
+ $error = __('No post/page ID was specified', $this -> plugin_name);
562
  }
563
  }
564
 
views/admin/galleries/index.php CHANGED
@@ -6,144 +6,151 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
 
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h1><?php _e('Manage Galleries', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New', $this -> plugin_name), $this -> url . '&amp;method=save', array('class' => "add-new-h2")); ?></h1>
9
-
10
- <?php if (!empty($galleries)) : ?>
11
  <form id="posts-filter" action="<?php echo $this -> url; ?>" method="post">
12
  <ul class="subsubsub">
13
  <li><?php echo $paginate -> allcount; ?> <?php _e('galleries', $this -> plugin_name); ?></li>
14
  </ul>
15
  </form>
 
 
 
16
 
17
- <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected galleries?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
18
-
19
- <?php wp_nonce_field($this -> sections -> galleries . '-bulkaction'); ?>
20
-
21
- <div class="tablenav">
22
- <div class="alignleft actions">
23
- <select name="action" class="action">
24
- <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
25
- <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
26
- </select>
27
- <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
28
- </div>
29
- <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
30
  </div>
31
-
32
- <?php
33
-
34
- $orderby = (empty($_GET['orderby'])) ? 'modified' : esc_html($_GET['orderby']);
35
- $order = (empty($_GET['order'])) ? 'desc' : strtolower(esc_html($_GET['order']));
36
- $otherorder = ($order == "desc") ? 'asc' : 'desc';
37
-
38
- ?>
39
 
40
- <table class="widefat">
41
- <thead>
42
- <tr>
43
- <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
44
- <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
45
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
46
- <span><?php _e('ID', $this -> plugin_name); ?></span>
47
- <span class="sorting-indicator"></span>
48
- </a>
49
- </th>
50
- <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
51
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
52
- <span><?php _e('Title', $this -> plugin_name); ?></span>
53
- <span class="sorting-indicator"></span>
54
- </a>
55
- </th>
56
- <th><?php _e('Slides', $this -> plugin_name); ?></th>
57
- <th><?php _e('Shortcode', $this -> plugin_name); ?></th>
58
- <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
59
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
60
- <span><?php _e('Date', $this -> plugin_name); ?></span>
61
- <span class="sorting-indicator"></span>
62
- </a>
63
- </th>
64
- </tr>
65
- </thead>
66
- <tfoot>
67
- <tr>
68
- <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
69
- <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
70
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
71
- <span><?php _e('ID', $this -> plugin_name); ?></span>
72
- <span class="sorting-indicator"></span>
73
- </a>
74
- </th>
75
- <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
76
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
77
- <span><?php _e('Title', $this -> plugin_name); ?></span>
78
- <span class="sorting-indicator"></span>
79
- </a>
80
- </th>
81
- <th><?php _e('Slides', $this -> plugin_name); ?></th>
82
- <th><?php _e('Shortcode', $this -> plugin_name); ?></th>
83
- <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
84
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
85
- <span><?php _e('Date', $this -> plugin_name); ?></span>
86
- <span class="sorting-indicator"></span>
87
- </a>
88
- </th>
89
- </tr>
90
- </tfoot>
91
- <tbody>
 
 
 
 
 
 
 
 
 
 
92
  <?php foreach ($galleries as $gallery) : ?>
93
  <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
94
  <th class="check-column"><input type="checkbox" name="Gallery[checklist][]" value="<?php echo $gallery -> id; ?>" id="checklist<?php echo $gallery -> id; ?>" /></th>
95
  <td><?php echo $gallery -> id; ?></td>
96
  <td>
97
- <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $gallery -> id; ?>" title=""><?php echo __($gallery -> title); ?></a>
98
- <div class="row-actions">
99
- <span class="view"><?php echo $this -> Html -> link(__('View', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=view&amp;id=" . $gallery -> id); ?> |</span>
100
- <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=save&amp;id=" . $gallery -> id); ?> |</span>
101
- <span class="edit"><?php echo $this -> Html -> link(__('Hardcode', $this -> plugin_name), '?page=' . $this -> sections -> galleries . "&amp;method=hardcode&amp;id=" . $gallery -> id); ?> |</span>
102
- <span class="edit"><?php echo $this -> Html -> link(__('Order Slides', $this -> plugin_name), '?page=' . $this -> sections -> slides . '&amp;method=order&amp;gallery_id=' . $gallery -> id); ?> |</span>
103
- <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=delete&amp;id=" . $gallery -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
104
- </div>
105
- </td>
106
- <td>
107
- <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=view&amp;id=<?php echo $gallery -> id; ?>"><?php echo $gallery -> slidescount; ?></a>
108
- </td>
109
- <td>
110
- <code>[tribulant_slideshow gallery_id="<?php echo $gallery -> id; ?>"]</code>
111
- </td>
112
  <td><abbr title="<?php echo $gallery -> modified; ?>"><?php echo date(get_option('date_format'), strtotime($gallery -> modified)); ?></abbr></td>
113
  </tr>
114
  <?php endforeach; ?>
115
- </tbody>
116
- </table>
117
-
118
- <div class="tablenav">
119
- <div class="alignleft">
120
- <?php if (empty($_GET['showall'])) : ?>
121
- <select class="widefat" style="width:auto;" name="perpage" onchange="change_perpage(this.value);">
122
- <option value=""><?php _e('- Per Page -', $this -> plugin_name); ?></option>
123
- <?php $p = 5; ?>
124
- <?php while ($p < 100) : ?>
125
- <option <?php echo (!empty($_COOKIE[$this -> pre . 'galleriesperpage']) && $_COOKIE[$this -> pre . 'galleriesperpage'] == $p) ? 'selected="selected"' : ''; ?> value="<?php echo $p; ?>"><?php echo $p; ?> <?php _e('per page', $this -> plugin_name); ?></option>
126
- <?php $p += 5; ?>
127
- <?php endwhile; ?>
128
- <?php if (isset($_COOKIE[$this -> pre . 'galleriesperpage'])) : ?>
129
- <option selected="selected" value="<?php echo $_COOKIE[$this -> pre . 'galleriesperpage']; ?>"><?php echo $_COOKIE[$this -> pre . 'galleriesperpage']; ?></option>
130
- <?php endif; ?>
131
- </select>
132
- <?php endif; ?>
133
-
134
- <script type="text/javascript">
135
- function change_perpage(perpage) {
136
- if (perpage != "") {
137
- document.cookie = "<?php echo $this -> pre; ?>galleriesperpage=" + perpage + "; expires=<?php echo GalleryHtmlHelper::gen_date($this -> get_option('cookieformat'), strtotime("+30 days")); ?> UTC; path=/";
138
- window.location = "<?php echo preg_replace("/\&?" . $this -> pre . "page\=(.*)?/si", "", $_SERVER['REQUEST_URI']); ?>";
139
- }
 
 
 
 
 
 
140
  }
141
- </script>
142
- </div>
143
- <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
144
  </div>
145
- </form>
146
- <?php else : ?>
147
- <p class="slideshow_error"><?php _e('No galleries are available.', $this -> plugin_name); ?></p>
148
- <?php endif; ?>
149
  </div>
6
 
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h1><?php _e('Manage Galleries', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New', $this -> plugin_name), $this -> url . '&amp;method=save', array('class' => "add-new-h2")); ?></h1>
9
+
10
+ <?php if (!empty($galleries)) : ?>
11
  <form id="posts-filter" action="<?php echo $this -> url; ?>" method="post">
12
  <ul class="subsubsub">
13
  <li><?php echo $paginate -> allcount; ?> <?php _e('galleries', $this -> plugin_name); ?></li>
14
  </ul>
15
  </form>
16
+ <?php endif; ?>
17
+
18
+ <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected galleries?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
19
 
20
+ <?php wp_nonce_field($this -> sections -> galleries . '-bulkaction'); ?>
21
+
22
+ <div class="tablenav">
23
+ <div class="alignleft actions">
24
+ <select name="action" class="action">
25
+ <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
26
+ <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
27
+ </select>
28
+ <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
 
 
 
 
29
  </div>
30
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
31
+ </div>
 
 
 
 
 
 
32
 
33
+ <?php
34
+
35
+ $orderby = (empty($_GET['orderby'])) ? 'modified' : esc_html($_GET['orderby']);
36
+ $order = (empty($_GET['order'])) ? 'desc' : strtolower(esc_html($_GET['order']));
37
+ $otherorder = ($order == "desc") ? 'asc' : 'desc';
38
+ $colspan = 6;
39
+
40
+ ?>
41
+
42
+ <table class="widefat">
43
+ <thead>
44
+ <tr>
45
+ <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
46
+ <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
47
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
48
+ <span><?php _e('ID', $this -> plugin_name); ?></span>
49
+ <span class="sorting-indicator"></span>
50
+ </a>
51
+ </th>
52
+ <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
53
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
54
+ <span><?php _e('Title', $this -> plugin_name); ?></span>
55
+ <span class="sorting-indicator"></span>
56
+ </a>
57
+ </th>
58
+ <th><?php _e('Slides', $this -> plugin_name); ?></th>
59
+ <th><?php _e('Shortcode', $this -> plugin_name); ?></th>
60
+ <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
61
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
62
+ <span><?php _e('Date', $this -> plugin_name); ?></span>
63
+ <span class="sorting-indicator"></span>
64
+ </a>
65
+ </th>
66
+ </tr>
67
+ </thead>
68
+ <tfoot>
69
+ <tr>
70
+ <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
71
+ <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
72
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
73
+ <span><?php _e('ID', $this -> plugin_name); ?></span>
74
+ <span class="sorting-indicator"></span>
75
+ </a>
76
+ </th>
77
+ <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
78
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
79
+ <span><?php _e('Title', $this -> plugin_name); ?></span>
80
+ <span class="sorting-indicator"></span>
81
+ </a>
82
+ </th>
83
+ <th><?php _e('Slides', $this -> plugin_name); ?></th>
84
+ <th><?php _e('Shortcode', $this -> plugin_name); ?></th>
85
+ <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
86
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
87
+ <span><?php _e('Date', $this -> plugin_name); ?></span>
88
+ <span class="sorting-indicator"></span>
89
+ </a>
90
+ </th>
91
+ </tr>
92
+ </tfoot>
93
+ <tbody>
94
+ <?php if (!empty($galleries)) : ?>
95
  <?php foreach ($galleries as $gallery) : ?>
96
  <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
97
  <th class="check-column"><input type="checkbox" name="Gallery[checklist][]" value="<?php echo $gallery -> id; ?>" id="checklist<?php echo $gallery -> id; ?>" /></th>
98
  <td><?php echo $gallery -> id; ?></td>
99
  <td>
100
+ <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $gallery -> id; ?>" title=""><?php echo __($gallery -> title); ?></a>
101
+ <div class="row-actions">
102
+ <span class="view"><?php echo $this -> Html -> link(__('View', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=view&amp;id=" . $gallery -> id); ?> |</span>
103
+ <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=save&amp;id=" . $gallery -> id); ?> |</span>
104
+ <span class="edit"><?php echo $this -> Html -> link(__('Hardcode', $this -> plugin_name), '?page=' . $this -> sections -> galleries . "&amp;method=hardcode&amp;id=" . $gallery -> id); ?> |</span>
105
+ <span class="edit"><?php echo $this -> Html -> link(__('Order Slides', $this -> plugin_name), '?page=' . $this -> sections -> slides . '&amp;method=order&amp;gallery_id=' . $gallery -> id); ?> |</span>
106
+ <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=delete&amp;id=" . $gallery -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
107
+ </div>
108
+ </td>
109
+ <td>
110
+ <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=view&amp;id=<?php echo $gallery -> id; ?>"><?php echo $gallery -> slidescount; ?></a>
111
+ </td>
112
+ <td>
113
+ <code>[tribulant_slideshow gallery_id="<?php echo $gallery -> id; ?>"]</code>
114
+ </td>
115
  <td><abbr title="<?php echo $gallery -> modified; ?>"><?php echo date(get_option('date_format'), strtotime($gallery -> modified)); ?></abbr></td>
116
  </tr>
117
  <?php endforeach; ?>
118
+ <?php else : ?>
119
+ <tr class="no-items">
120
+ <td class="colspanchange" colspan="<?php echo $colspan; ?>">
121
+ <?php echo sprintf(__('No galleries available, %s', $this -> plugin_name), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> galleries . '&method=save') . '">' . __('add one', $this -> plugin_name) . '</a>'); ?>
122
+ </td>
123
+ </tr>
124
+ <?php endif; ?>
125
+ </tbody>
126
+ </table>
127
+
128
+ <div class="tablenav">
129
+ <div class="alignleft">
130
+ <?php if (empty($_GET['showall'])) : ?>
131
+ <select class="widefat" style="width:auto;" name="perpage" onchange="change_perpage(this.value);">
132
+ <option value=""><?php _e('- Per Page -', $this -> plugin_name); ?></option>
133
+ <?php $p = 5; ?>
134
+ <?php while ($p < 100) : ?>
135
+ <option <?php echo (!empty($_COOKIE[$this -> pre . 'galleriesperpage']) && $_COOKIE[$this -> pre . 'galleriesperpage'] == $p) ? 'selected="selected"' : ''; ?> value="<?php echo $p; ?>"><?php echo $p; ?> <?php _e('per page', $this -> plugin_name); ?></option>
136
+ <?php $p += 5; ?>
137
+ <?php endwhile; ?>
138
+ <?php if (isset($_COOKIE[$this -> pre . 'galleriesperpage'])) : ?>
139
+ <option selected="selected" value="<?php echo $_COOKIE[$this -> pre . 'galleriesperpage']; ?>"><?php echo $_COOKIE[$this -> pre . 'galleriesperpage']; ?></option>
140
+ <?php endif; ?>
141
+ </select>
142
+ <?php endif; ?>
143
+
144
+ <script type="text/javascript">
145
+ function change_perpage(perpage) {
146
+ if (perpage != "") {
147
+ document.cookie = "<?php echo $this -> pre; ?>galleriesperpage=" + perpage + "; expires=<?php echo GalleryHtmlHelper::gen_date($this -> get_option('cookieformat'), strtotime("+30 days")); ?> UTC; path=/";
148
+ window.location = "<?php echo preg_replace("/\&?" . $this -> pre . "page\=(.*)?/si", "", $_SERVER['REQUEST_URI']); ?>";
149
  }
150
+ }
151
+ </script>
 
152
  </div>
153
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
154
+ </div>
155
+ </form>
 
156
  </div>
views/admin/slides/loop.php CHANGED
@@ -4,223 +4,228 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  ?>
6
 
7
- <?php if (!empty($slides)) : ?>
8
- <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
9
-
10
- <?php wp_nonce_field($this -> sections -> slides . '-bulkaction'); ?>
11
-
12
- <div class="tablenav">
13
- <div class="alignleft actions">
14
- <?php if (!empty($_GET['page']) && $_GET['page'] == $this -> sections -> galleries) : ?>
15
- <a href="?page=<?php echo $this -> sections -> slides; ?>&amp;method=order&amp;gallery_id=<?php echo $gallery -> id; ?>" class="button"><i class="fa fa-sort"></i> <?php _e('Order Slides', $this -> plugin_name); ?></a>
16
- <?php else : ?>
17
- <a href="<?php echo $this -> url; ?>&amp;method=order" class="button"><i class="fa fa-sort"></i> <?php _e('Order Slides', $this -> plugin_name); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  <?php endif; ?>
19
- </div>
20
- <div class="alignleft actions">
21
- <select name="action" class="action" onchange="change_action(this.value);">
22
- <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
23
- <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
24
- <optgroup label="<?php _e('Galleries', $this -> plugin_name); ?>">
25
- <option value="addgalleries"><?php _e('Add Galleries...', $this -> plugin_name); ?></option>
26
- <option value="setgalleries"><?php _e('Set Galleries...', $this -> plugin_name); ?></option>
27
- <option value="remgalleries"><?php _e('Remove All Galleries', $this -> plugin_name); ?></option>
28
- </optgroup>
29
- </select>
30
- <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
31
- </div>
32
- <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
33
- </div>
34
-
35
- <div id="action_galleries_div" style="display:none;">
36
- <?php if ($galleries = $this -> Gallery() -> select()) : ?>
37
- <div><label style="font-weight:bold"><input onclick="jqCheckAll(this, false, 'galleries');" type="checkbox" name="checkboxall" value="1" /> <?php _e('Select all', $this -> plugin_name); ?></label></div>
38
- <?php foreach ($galleries as $gallery_id => $gallery_name) : ?>
39
- <div><label><input type="checkbox" name="galleries[]" value="<?php echo $gallery_id; ?>" /> <?php _e($gallery_name); ?></label></div>
40
- <?php endforeach; ?>
41
- <?php else : ?>
42
- <p class="slideshow_error"><?php _e('No galleries are available', $this -> plugin_name); ?></p>
43
- <?php endif; ?>
44
- </div>
45
 
46
  <script type="text/javascript">
47
- function change_action(action) {
48
- switch (action) {
49
- case 'addgalleries' :
50
- case 'setgalleries' :
51
- jQuery('#action_galleries_div').show();
52
- break;
53
- default :
54
- jQuery('#action_galleries_div').hide();
55
- break;
56
  }
57
  }
58
  </script>
59
-
60
- <?php
61
-
62
- $orderby = (empty($_GET['orderby'])) ? 'modified' : esc_html($_GET['orderby']);
63
- $order = (empty($_GET['order'])) ? 'desc' : strtolower(esc_html($_GET['order']));
64
- $otherorder = ($order == "desc") ? 'asc' : 'desc';
65
-
66
- ?>
67
-
68
- <table class="widefat">
69
- <thead>
70
- <tr>
71
- <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
72
- <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
73
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
74
- <span><?php _e('ID', $this -> plugin_name); ?></span>
75
- <span class="sorting-indicator"></span>
76
- </a>
77
- </th>
78
- <th class="column-image <?php echo ($orderby == "image") ? 'sorted ' . $order : 'sortable desc'; ?>">
79
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=image&order=' . (($orderby == "image") ? $otherorder : "asc")); ?>">
80
- <span><?php _e('Image', $this -> plugin_name); ?></span>
81
- <span class="sorting-indicator"></span>
82
- </a>
83
- </th>
84
- <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
85
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
86
- <span><?php _e('Title', $this -> plugin_name); ?></span>
87
- <span class="sorting-indicator"></span>
88
- </a>
89
- </th>
90
- <th><?php _e('Galleries', $this -> plugin_name); ?></th>
91
- <th class="column-uselink <?php echo ($orderby == "uselink") ? 'sorted ' . $order : 'sortable desc'; ?>">
92
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=uselink&order=' . (($orderby == "uselink") ? $otherorder : "asc")); ?>">
93
- <span><?php _e('Link', $this -> plugin_name); ?></span>
94
- <span class="sorting-indicator"></span>
95
- </a>
96
- </th>
97
- <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
98
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
99
- <span><?php _e('Date', $this -> plugin_name); ?></span>
100
- <span class="sorting-indicator"></span>
101
- </a>
102
- </th>
103
- <th class="column-order <?php echo ($orderby == "order") ? 'sorted ' . $order : 'sortable desc'; ?>">
104
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=order&order=' . (($orderby == "order") ? $otherorder : "asc")); ?>">
105
- <span><?php _e('Order', $this -> plugin_name); ?></span>
106
- <span class="sorting-indicator"></span>
107
- </a>
108
- </th>
109
- </tr>
110
- </thead>
111
- <tfoot>
112
- <tr>
113
- <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
114
- <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
115
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
116
- <span><?php _e('ID', $this -> plugin_name); ?></span>
117
- <span class="sorting-indicator"></span>
118
- </a>
119
- </th>
120
- <th class="column-image <?php echo ($orderby == "image") ? 'sorted ' . $order : 'sortable desc'; ?>">
121
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=image&order=' . (($orderby == "image") ? $otherorder : "asc")); ?>">
122
- <span><?php _e('Image', $this -> plugin_name); ?></span>
123
- <span class="sorting-indicator"></span>
124
- </a>
125
- </th>
126
- <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
127
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
128
- <span><?php _e('Title', $this -> plugin_name); ?></span>
129
- <span class="sorting-indicator"></span>
130
- </a>
131
- </th>
132
- <th><?php _e('Galleries', $this -> plugin_name); ?></th>
133
- <th class="column-uselink <?php echo ($orderby == "uselink") ? 'sorted ' . $order : 'sortable desc'; ?>">
134
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=uselink&order=' . (($orderby == "uselink") ? $otherorder : "asc")); ?>">
135
- <span><?php _e('Link', $this -> plugin_name); ?></span>
136
- <span class="sorting-indicator"></span>
137
- </a>
138
- </th>
139
- <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
140
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
141
- <span><?php _e('Date', $this -> plugin_name); ?></span>
142
- <span class="sorting-indicator"></span>
143
- </a>
144
- </th>
145
- <th class="column-order <?php echo ($orderby == "order") ? 'sorted ' . $order : 'sortable desc'; ?>">
146
- <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=order&order=' . (($orderby == "order") ? $otherorder : "asc")); ?>">
147
- <span><?php _e('Order', $this -> plugin_name); ?></span>
148
- <span class="sorting-indicator"></span>
149
- </a>
150
- </th>
151
- </tr>
152
- </tfoot>
153
- <tbody>
154
- <?php foreach ($slides as $slide) : ?>
155
- <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
156
- <th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?php echo $slide -> id; ?>" id="checklist<?php echo $slide -> id; ?>" /></th>
157
- <td><label for="checklist<?php echo $slide -> id; ?>"><?php echo $slide -> id; ?></label></td>
158
- <td style="width:75px;">
159
- <?php $image = $slide -> image; ?>
160
- <a href="<?php echo $slide -> image_path; ?>" title="<?php echo __($slide -> title); ?>" class="colorbox" rel="slides"><img class="img-rounded" src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, 50, 50, 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
161
- </td>
162
- <td>
163
- <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $slide -> id; ?>" title=""><?php echo __($slide -> title); ?></a>
164
- <div class="row-actions">
165
- <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> slides . "&amp;method=save&amp;id=" . $slide -> id); ?> |</span>
166
- <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> slides . "&amp;method=delete&amp;id=" . $slide -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
167
- </div>
168
- </td>
169
- <td>
170
- <?php if (!empty($slide -> gallery)) : ?>
171
- <?php $g = 1; ?>
172
- <?php foreach ($slide -> gallery as $gallery) : ?>
173
- <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=view&amp;id=<?php echo $gallery -> id; ?>" title="<?php echo esc_attr(__($gallery -> title)); ?>"><?php echo __($gallery -> title); ?></a>
174
- <?php if ($g < count($slide -> gallery)) : ?>, <?php endif; ?>
175
- <?php $g++; ?>
176
- <?php endforeach; ?>
177
- <?php else : ?>
178
- <?php _e('None', $this -> plugin_name); ?>
179
- <?php endif; ?>
180
- </td>
181
- <td>
182
- <?php if (!empty($slide -> uselink) && $slide -> uselink == "Y") : ?>
183
- <span class="slideshow_success"><i class="fa fa-check"></i></span>
184
- <small>(<a href="<?php echo __($slide -> link); ?>" title="" target="_blank"><?php _e('Open', $this -> plugin_name); ?></a>)</small>
185
- <?php else : ?>
186
- <span class="slideshow_error"><i class="fa fa-times"></i></span>
187
- <?php endif; ?>
188
- </td>
189
- <td><abbr title="<?php echo $slide -> modified; ?>"><?php echo date(get_option('date_format'), strtotime($slide -> modified)); ?></abbr></td>
190
- <td><?php echo ((int) $slide -> order + 1); ?></td>
191
- </tr>
192
- <?php endforeach; ?>
193
- </tbody>
194
- </table>
195
-
196
- <div class="tablenav">
197
- <div class="alignleft">
198
- <?php if (empty($_GET['showall'])) : ?>
199
- <select class="widefat" style="width:auto;" name="perpage" onchange="change_perpage(this.value);">
200
- <option value=""><?php _e('- Per Page -', $this -> plugin_name); ?></option>
201
- <?php $p = 5; ?>
202
- <?php while ($p < 100) : ?>
203
- <option <?php echo (!empty($_COOKIE[$this -> pre . 'slidesperpage']) && $_COOKIE[$this -> pre . 'slidesperpage'] == $p) ? 'selected="selected"' : ''; ?> value="<?php echo $p; ?>"><?php echo $p; ?> <?php _e('per page', $this -> plugin_name); ?></option>
204
- <?php $p += 5; ?>
205
- <?php endwhile; ?>
206
- <?php if (isset($_COOKIE[$this -> pre . 'slidesperpage'])) : ?>
207
- <option selected="selected" value="<?php echo $_COOKIE[$this -> pre . 'slidesperpage']; ?>"><?php echo $_COOKIE[$this -> pre . 'slidesperpage']; ?></option>
208
- <?php endif; ?>
209
- </select>
210
- <?php endif; ?>
211
-
212
- <script type="text/javascript">
213
- function change_perpage(perpage) {
214
- if (perpage != "") {
215
- document.cookie = "<?php echo $this -> pre; ?>slidesperpage=" + perpage + "; expires=<?php echo GalleryHtmlHelper::gen_date($this -> get_option('cookieformat'), strtotime("+30 days")); ?> UTC; path=/";
216
- window.location = "<?php echo preg_replace("/\&?" . $this -> pre . "page\=(.*)?/si", "", $_SERVER['REQUEST_URI']); ?>";
217
- }
218
- }
219
- </script>
220
- </div>
221
- <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
222
- </div>
223
- </form>
224
- <?php else : ?>
225
- <p class="slideshow_error"><?php _e('No slides found', $this -> plugin_name); ?></p>
226
- <?php endif; ?>
4
 
5
  ?>
6
 
7
+ <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
8
+
9
+ <?php wp_nonce_field($this -> sections -> slides . '-bulkaction'); ?>
10
+
11
+ <div class="tablenav">
12
+ <div class="alignleft actions">
13
+ <?php if (!empty($_GET['page']) && $_GET['page'] == $this -> sections -> galleries) : ?>
14
+ <a href="?page=<?php echo $this -> sections -> slides; ?>&amp;method=order&amp;gallery_id=<?php echo $gallery -> id; ?>" class="button"><i class="fa fa-sort"></i> <?php _e('Order Slides', $this -> plugin_name); ?></a>
15
+ <?php else : ?>
16
+ <a href="<?php echo $this -> url; ?>&amp;method=order" class="button"><i class="fa fa-sort"></i> <?php _e('Order Slides', $this -> plugin_name); ?></a>
17
+ <?php endif; ?>
18
+ </div>
19
+ <div class="alignleft actions">
20
+ <select name="action" class="action" onchange="change_action(this.value);">
21
+ <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
22
+ <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
23
+ <optgroup label="<?php _e('Galleries', $this -> plugin_name); ?>">
24
+ <option value="addgalleries"><?php _e('Add Galleries...', $this -> plugin_name); ?></option>
25
+ <option value="setgalleries"><?php _e('Set Galleries...', $this -> plugin_name); ?></option>
26
+ <option value="remgalleries"><?php _e('Remove All Galleries', $this -> plugin_name); ?></option>
27
+ </optgroup>
28
+ </select>
29
+ <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
30
+ </div>
31
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
32
+ </div>
33
+
34
+ <div id="action_galleries_div" style="display:none;">
35
+ <?php if ($galleries = $this -> Gallery() -> select()) : ?>
36
+ <div><label style="font-weight:bold"><input onclick="jqCheckAll(this, false, 'galleries');" type="checkbox" name="checkboxall" value="1" /> <?php _e('Select all', $this -> plugin_name); ?></label></div>
37
+ <?php foreach ($galleries as $gallery_id => $gallery_name) : ?>
38
+ <div><label><input type="checkbox" name="galleries[]" value="<?php echo $gallery_id; ?>" /> <?php _e($gallery_name); ?></label></div>
39
+ <?php endforeach; ?>
40
+ <?php else : ?>
41
+ <p class="slideshow_error"><?php _e('No galleries are available', $this -> plugin_name); ?></p>
42
+ <?php endif; ?>
43
+ </div>
44
+
45
+ <script type="text/javascript">
46
+ function change_action(action) {
47
+ switch (action) {
48
+ case 'addgalleries' :
49
+ case 'setgalleries' :
50
+ jQuery('#action_galleries_div').show();
51
+ break;
52
+ default :
53
+ jQuery('#action_galleries_div').hide();
54
+ break;
55
+ }
56
+ }
57
+ </script>
58
+
59
+ <?php
60
+
61
+ $orderby = (empty($_GET['orderby'])) ? 'modified' : esc_html($_GET['orderby']);
62
+ $order = (empty($_GET['order'])) ? 'desc' : strtolower(esc_html($_GET['order']));
63
+ $otherorder = ($order == "desc") ? 'asc' : 'desc';
64
+ $colspan = 8;
65
+
66
+ ?>
67
+
68
+ <table class="widefat">
69
+ <thead>
70
+ <tr>
71
+ <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
72
+ <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
73
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
74
+ <span><?php _e('ID', $this -> plugin_name); ?></span>
75
+ <span class="sorting-indicator"></span>
76
+ </a>
77
+ </th>
78
+ <th class="column-image <?php echo ($orderby == "image") ? 'sorted ' . $order : 'sortable desc'; ?>">
79
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=image&order=' . (($orderby == "image") ? $otherorder : "asc")); ?>">
80
+ <span><?php _e('Image', $this -> plugin_name); ?></span>
81
+ <span class="sorting-indicator"></span>
82
+ </a>
83
+ </th>
84
+ <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
85
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
86
+ <span><?php _e('Title', $this -> plugin_name); ?></span>
87
+ <span class="sorting-indicator"></span>
88
+ </a>
89
+ </th>
90
+ <th><?php _e('Galleries', $this -> plugin_name); ?></th>
91
+ <th class="column-uselink <?php echo ($orderby == "uselink") ? 'sorted ' . $order : 'sortable desc'; ?>">
92
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=uselink&order=' . (($orderby == "uselink") ? $otherorder : "asc")); ?>">
93
+ <span><?php _e('Link', $this -> plugin_name); ?></span>
94
+ <span class="sorting-indicator"></span>
95
+ </a>
96
+ </th>
97
+ <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
98
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
99
+ <span><?php _e('Date', $this -> plugin_name); ?></span>
100
+ <span class="sorting-indicator"></span>
101
+ </a>
102
+ </th>
103
+ <th class="column-order <?php echo ($orderby == "order") ? 'sorted ' . $order : 'sortable desc'; ?>">
104
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=order&order=' . (($orderby == "order") ? $otherorder : "asc")); ?>">
105
+ <span><?php _e('Order', $this -> plugin_name); ?></span>
106
+ <span class="sorting-indicator"></span>
107
+ </a>
108
+ </th>
109
+ </tr>
110
+ </thead>
111
+ <tfoot>
112
+ <tr>
113
+ <td class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></td>
114
+ <th class="column-id <?php echo ($orderby == "id") ? 'sorted ' . $order : 'sortable desc'; ?>">
115
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=id&order=' . (($orderby == "id") ? $otherorder : "asc")); ?>">
116
+ <span><?php _e('ID', $this -> plugin_name); ?></span>
117
+ <span class="sorting-indicator"></span>
118
+ </a>
119
+ </th>
120
+ <th class="column-image <?php echo ($orderby == "image") ? 'sorted ' . $order : 'sortable desc'; ?>">
121
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=image&order=' . (($orderby == "image") ? $otherorder : "asc")); ?>">
122
+ <span><?php _e('Image', $this -> plugin_name); ?></span>
123
+ <span class="sorting-indicator"></span>
124
+ </a>
125
+ </th>
126
+ <th class="column-title <?php echo ($orderby == "title") ? 'sorted ' . $order : 'sortable desc'; ?>">
127
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=title&order=' . (($orderby == "title") ? $otherorder : "asc")); ?>">
128
+ <span><?php _e('Title', $this -> plugin_name); ?></span>
129
+ <span class="sorting-indicator"></span>
130
+ </a>
131
+ </th>
132
+ <th><?php _e('Galleries', $this -> plugin_name); ?></th>
133
+ <th class="column-uselink <?php echo ($orderby == "uselink") ? 'sorted ' . $order : 'sortable desc'; ?>">
134
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=uselink&order=' . (($orderby == "uselink") ? $otherorder : "asc")); ?>">
135
+ <span><?php _e('Link', $this -> plugin_name); ?></span>
136
+ <span class="sorting-indicator"></span>
137
+ </a>
138
+ </th>
139
+ <th class="column-modified <?php echo ($orderby == "modified") ? 'sorted ' . $order : 'sortable desc'; ?>">
140
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=modified&order=' . (($orderby == "modified") ? $otherorder : "asc")); ?>">
141
+ <span><?php _e('Date', $this -> plugin_name); ?></span>
142
+ <span class="sorting-indicator"></span>
143
+ </a>
144
+ </th>
145
+ <th class="column-order <?php echo ($orderby == "order") ? 'sorted ' . $order : 'sortable desc'; ?>">
146
+ <a href="<?php echo GalleryHtmlHelper::retainquery('orderby=order&order=' . (($orderby == "order") ? $otherorder : "asc")); ?>">
147
+ <span><?php _e('Order', $this -> plugin_name); ?></span>
148
+ <span class="sorting-indicator"></span>
149
+ </a>
150
+ </th>
151
+ </tr>
152
+ </tfoot>
153
+ <tbody>
154
+ <?php if (!empty($slides)) : ?>
155
+ <?php foreach ($slides as $slide) : ?>
156
+ <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
157
+ <th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?php echo $slide -> id; ?>" id="checklist<?php echo $slide -> id; ?>" /></th>
158
+ <td><label for="checklist<?php echo $slide -> id; ?>"><?php echo $slide -> id; ?></label></td>
159
+ <td style="width:75px;">
160
+ <?php $image = $slide -> image; ?>
161
+ <a href="<?php echo $slide -> image_path; ?>" title="<?php echo __($slide -> title); ?>" class="colorbox" rel="slides"><img class="img-rounded" src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, 50, 50, 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
162
+ </td>
163
+ <td>
164
+ <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $slide -> id; ?>" title=""><?php echo __($slide -> title); ?></a>
165
+ <div class="row-actions">
166
+ <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> slides . "&amp;method=save&amp;id=" . $slide -> id); ?> |</span>
167
+ <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> slides . "&amp;method=delete&amp;id=" . $slide -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
168
+ </div>
169
+ </td>
170
+ <td>
171
+ <?php if (!empty($slide -> gallery)) : ?>
172
+ <?php $g = 1; ?>
173
+ <?php foreach ($slide -> gallery as $gallery) : ?>
174
+ <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=view&amp;id=<?php echo $gallery -> id; ?>" title="<?php echo esc_attr(__($gallery -> title)); ?>"><?php echo __($gallery -> title); ?></a>
175
+ <?php if ($g < count($slide -> gallery)) : ?>, <?php endif; ?>
176
+ <?php $g++; ?>
177
+ <?php endforeach; ?>
178
+ <?php else : ?>
179
+ <?php _e('None', $this -> plugin_name); ?>
180
+ <?php endif; ?>
181
+ </td>
182
+ <td>
183
+ <?php if (!empty($slide -> uselink) && $slide -> uselink == "Y") : ?>
184
+ <span class="slideshow_success"><i class="fa fa-check"></i></span>
185
+ <small>(<a href="<?php echo __($slide -> link); ?>" title="" target="_blank"><?php _e('Open', $this -> plugin_name); ?></a>)</small>
186
+ <?php else : ?>
187
+ <span class="slideshow_error"><i class="fa fa-times"></i></span>
188
+ <?php endif; ?>
189
+ </td>
190
+ <td><abbr title="<?php echo $slide -> modified; ?>"><?php echo date(get_option('date_format'), strtotime($slide -> modified)); ?></abbr></td>
191
+ <td><?php echo ((int) $slide -> order + 1); ?></td>
192
+ </tr>
193
+ <?php endforeach; ?>
194
+ <?php else : ?>
195
+ <tr class="no-items">
196
+ <td class="colspanchange" colspan="<?php echo $colspan; ?>">
197
+ <?php echo sprintf(__('No slides available, %s or %s', $this -> plugin_name), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> slides . '&method=save') . '">' . __('add one', $this -> plugin_name) . '</a>', '<a href="' . admin_url('admin.php?page=' . $this -> sections -> slides . '&method=save-multiple') . '">' . __('add multiple', $this -> plugin_name) . '</a>'); ?>
198
+ </td>
199
+ </tr>
200
+ <?php endif; ?>
201
+ </tbody>
202
+ </table>
203
+
204
+ <div class="tablenav">
205
+ <div class="alignleft">
206
+ <?php if (empty($_GET['showall'])) : ?>
207
+ <select class="widefat" style="width:auto;" name="perpage" onchange="change_perpage(this.value);">
208
+ <option value=""><?php _e('- Per Page -', $this -> plugin_name); ?></option>
209
+ <?php $p = 5; ?>
210
+ <?php while ($p < 100) : ?>
211
+ <option <?php echo (!empty($_COOKIE[$this -> pre . 'slidesperpage']) && $_COOKIE[$this -> pre . 'slidesperpage'] == $p) ? 'selected="selected"' : ''; ?> value="<?php echo $p; ?>"><?php echo $p; ?> <?php _e('per page', $this -> plugin_name); ?></option>
212
+ <?php $p += 5; ?>
213
+ <?php endwhile; ?>
214
+ <?php if (isset($_COOKIE[$this -> pre . 'slidesperpage'])) : ?>
215
+ <option selected="selected" value="<?php echo $_COOKIE[$this -> pre . 'slidesperpage']; ?>"><?php echo $_COOKIE[$this -> pre . 'slidesperpage']; ?></option>
216
  <?php endif; ?>
217
+ </select>
218
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
  <script type="text/javascript">
221
+ function change_perpage(perpage) {
222
+ if (perpage != "") {
223
+ document.cookie = "<?php echo $this -> pre; ?>slidesperpage=" + perpage + "; expires=<?php echo GalleryHtmlHelper::gen_date($this -> get_option('cookieformat'), strtotime("+30 days")); ?> UTC; path=/";
224
+ window.location = "<?php echo preg_replace("/\&?" . $this -> pre . "page\=(.*)?/si", "", $_SERVER['REQUEST_URI']); ?>";
 
 
 
 
 
225
  }
226
  }
227
  </script>
228
+ </div>
229
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
230
+ </div>
231
+ </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/slides/save.php CHANGED
@@ -49,7 +49,7 @@ if ($this -> language_do()) {
49
  });
50
  </script>
51
  <?php else : ?>
52
- <input class="widefat" type="text" name="Slide[title]" value="<?php echo esc_attr($this -> Slide() -> data -> title); ?>" id="Slide.title" />
53
  <?php endif; ?>
54
  <span class="howto"><?php _e('Title/name of your slide as it will be displayed to your users.', $this -> plugin_name); ?></span>
55
  <?php echo (!empty($this -> Slide() -> errors['title'])) ? '<div class="slideshow_error">' . $this -> Slide() -> errors['title'] . '</div>' : ''; ?>
49
  });
50
  </script>
51
  <?php else : ?>
52
+ <input class="widefat" type="text" name="Slide[title]" value="<?php echo esc_attr(stripslashes($this -> Slide() -> data -> title)); ?>" id="Slide.title" />
53
  <?php endif; ?>
54
  <span class="howto"><?php _e('Title/name of your slide as it will be displayed to your users.', $this -> plugin_name); ?></span>
55
  <?php echo (!empty($this -> Slide() -> errors['title'])) ? '<div class="slideshow_error">' . $this -> Slide() -> errors['title'] . '</div>' : ''; ?>
views/admin/tinymce-dialog.php CHANGED
@@ -14,6 +14,7 @@ if ($oc_galleries = wp_cache_get($query_hash, 'slideshowgallery')) {
14
  }
15
 
16
  $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
 
17
 
18
  ?>
19
 
@@ -54,6 +55,12 @@ $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
54
  var tag = '[tribulant_slideshow gallery_id="' + gallery_id + '"';
55
  if (exclude != "" && exclude != "undefined" && exclude != undefined) { tag += ' exclude="' + exclude + '"'; }
56
  tag += ']';
 
 
 
 
 
 
57
  } else if (slideshow_type == "products") {
58
  var slideshow_products = jQuery('#slideshow_products').val();
59
  var slideshow_productsnumber = jQuery('#slideshow_productsnumber').val();
@@ -67,6 +74,17 @@ $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
67
  }
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
70
  function closePopup() {
71
  tinyMCEPopup.close();
72
  }
@@ -87,10 +105,11 @@ $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
87
 
88
  <form onsubmit="insertTag(); return false;" action="#">
89
  <div class="panel_wrapper">
90
- <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#products_div').hide(); jQuery('#post_div').show(); jQuery('#gallery_div').hide();" type="radio" name="slideshow_type" value="post" id="type_post" /> <?php _e('Images From a Post', $this -> plugin_name); ?></label><br/>
91
- <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#products_div').hide(); jQuery('#post_div').hide(); jQuery('#gallery_div').show();" type="radio" name="slideshow_type" value="gallery" id="type_gallery" /> <?php _e('Slides From a Gallery', $this -> plugin_name); ?></label><br/>
92
- <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#products_div').hide(); jQuery('#post_div').hide(); jQuery('#gallery_div').hide();" type="radio" name="slideshow_type" value="custom" id="type_custom" /> <?php _e('All Available Slides', $this -> plugin_name); ?></label><br/>
93
- <label style="font-weight:bold; cursor:pointer;"><input <?php echo (!$checkout_active) ? 'disabled="disabled"' : ''; ?> onclick="jQuery('#products_div').show(); jQuery('#post_div').hide(); jQuery('#gallery_div').hide();" type="radio" name="slideshow_type" value="products" id="type_products" /> <?php _e('Products', $this -> plugin_name); ?></label>
 
94
  <?php if (!$checkout_active) : ?>
95
  <small>(<span class="slideshow_error"><?php echo sprintf(__('Requires the %sShopping Cart plugin%s', $this -> plugin_name), '<a href="http://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" target="_blank">', '</a>'); ?></span>)</small>
96
  <?php endif; ?>
@@ -141,6 +160,22 @@ $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
141
  </p>
142
  </div>
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  <p>
145
  <label style="font-weight:bold;"><?php _e('Exclude:', $this -> plugin_name); ?></label><br/>
146
  <input type="text" name="exclude" value="" id="exclude" /><br/>
14
  }
15
 
16
  $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
17
+ $post_types = get_post_types(array('public' => true), 'objects');
18
 
19
  ?>
20
 
55
  var tag = '[tribulant_slideshow gallery_id="' + gallery_id + '"';
56
  if (exclude != "" && exclude != "undefined" && exclude != undefined) { tag += ' exclude="' + exclude + '"'; }
57
  tag += ']';
58
+ } else if (slideshow_type == "featured") {
59
+
60
+ var featurednumber = jQuery('#featurednumber').val();
61
+ var featuredtype = jQuery('#featuredtype').val();
62
+
63
+ var tag = '[tribulant_slideshow featured="true" featurednumber="' + featurednumber + '" featuredtype="' + featuredtype + '"]';
64
  } else if (slideshow_type == "products") {
65
  var slideshow_products = jQuery('#slideshow_products').val();
66
  var slideshow_productsnumber = jQuery('#slideshow_productsnumber').val();
74
  }
75
  }
76
 
77
+ function changeType(type) {
78
+ jQuery('#products_div').hide();
79
+ jQuery('#post_div').hide();
80
+ jQuery('#gallery_div').hide();
81
+ jQuery('#featured_div').hide();
82
+
83
+ if (typeof(type) !== "undefined" && type != "") {
84
+ jQuery('#' + type + '_div').show();
85
+ }
86
+ }
87
+
88
  function closePopup() {
89
  tinyMCEPopup.close();
90
  }
105
 
106
  <form onsubmit="insertTag(); return false;" action="#">
107
  <div class="panel_wrapper">
108
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="changeType(this.value);" type="radio" name="slideshow_type" value="post" id="type_post" /> <?php _e('Images From a Post', $this -> plugin_name); ?></label><br/>
109
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="changeType(this.value);" type="radio" name="slideshow_type" value="gallery" id="type_gallery" /> <?php _e('Slides From a Gallery', $this -> plugin_name); ?></label><br/>
110
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="changeType(this.value);" type="radio" name="slideshow_type" value="featured" id="type_gallery" /> <?php _e('Featured Posts', $this -> plugin_name); ?></label><br/>
111
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="changeType(this.value);" type="radio" name="slideshow_type" value="custom" id="type_custom" /> <?php _e('All Available Slides', $this -> plugin_name); ?></label><br/>
112
+ <label style="font-weight:bold; cursor:pointer;"><input <?php echo (!$checkout_active) ? 'disabled="disabled"' : ''; ?> onclick="changeType(this.value);" type="radio" name="slideshow_type" value="products" id="type_products" /> <?php _e('Products', $this -> plugin_name); ?></label>
113
  <?php if (!$checkout_active) : ?>
114
  <small>(<span class="slideshow_error"><?php echo sprintf(__('Requires the %sShopping Cart plugin%s', $this -> plugin_name), '<a href="http://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" target="_blank">', '</a>'); ?></span>)</small>
115
  <?php endif; ?>
160
  </p>
161
  </div>
162
 
163
+ <div id="featured_div" style="display:none;">
164
+ <p>
165
+ <label for="featurednumber"><?php _e('Number of Posts:', $this -> plugin_name); ?></label>
166
+ <input type="text" name="featurednumber" id="featurednumber" value="" />
167
+ </p>
168
+
169
+ <p>
170
+ <label for="featuredtype"><?php _e('Post Type:', $this -> plugin_name); ?></label>
171
+ <select name="featuredtype" id="featuredtype">
172
+ <?php foreach ($post_types as $post_type_key => $post_type) : ?>
173
+ <option value="<?php echo $post_type_key; ?>"><?php echo $post_type -> labels -> name; ?></option>
174
+ <?php endforeach; ?>
175
+ </select>
176
+ </p>
177
+ </div>
178
+
179
  <p>
180
  <label style="font-weight:bold;"><?php _e('Exclude:', $this -> plugin_name); ?></label><br/>
181
  <input type="text" name="exclude" value="" id="exclude" /><br/>