| 1 |
<?php if ($data instanceof stdClass) : ?> |
| 2 |
|
| 3 |
<a |
| 4 |
href="#TB_inline?width=450&inlineId=insertSlideshowShortcode" |
| 5 |
class="button thickbox" |
| 6 |
title="<?php _e('Insert a Slideshow', 'slideshow-se'); ?>" |
| 7 |
style="padding-left: .4em;" |
| 8 |
> |
| 9 |
<img |
| 10 |
src="<?php echo SlideshowSEPluginMain::getPluginUrl() . '/images/SlideshowSEPluginPostType/adminIcon.png'; ?>" |
| 11 |
alt="<?php _e('Insert a Slideshow', 'slideshow-se'); ?>" |
| 12 |
style="vertical-align: text-top;" |
| 13 |
/> |
| 14 |
<?php _e('Insert Slideshow', 'slideshow-se'); ?> |
| 15 |
</a> |
| 16 |
|
| 17 |
<div id="insertSlideshowShortcode" style="display: none;"> |
| 18 |
|
| 19 |
<h3 style="padding: 10px 0; color: #5a5a5a;"> |
| 20 |
<?php _e('Insert a Slideshow', 'slideshow-se'); ?> |
| 21 |
</h3> |
| 22 |
|
| 23 |
<div style="border: 1px solid #ddd; padding: 10px; color: #5a5a5a;"> |
| 24 |
|
| 25 |
<?php if($data->slideshows instanceof WP_Query && count($data->slideshows->get_posts()) > 0): ?> |
| 26 |
<table> |
| 27 |
<tr> |
| 28 |
|
| 29 |
<td><?php _e('Select a slideshow', 'slideshow-se'); ?></td> |
| 30 |
<td> |
| 31 |
<select id="insertSlideshowShortcodeSlideshowSelect"> |
| 32 |
|
| 33 |
<?php foreach($data->slideshows->get_posts() as $slideshow): ?> |
| 34 |
|
| 35 |
<?php if(!is_numeric($slideshow->ID)) continue; ?> |
| 36 |
|
| 37 |
<option value="<?php echo $slideshow->ID; ?>"> |
| 38 |
<?php echo (!empty($slideshow->post_title)) ? htmlspecialchars($slideshow->post_title) : __('Untitled slideshow', 'slideshow-se'); ?> |
| 39 |
</option> |
| 40 |
|
| 41 |
<?php endforeach; ?> |
| 42 |
|
| 43 |
</select> |
| 44 |
</td> |
| 45 |
|
| 46 |
</tr> |
| 47 |
<tr> |
| 48 |
|
| 49 |
<td> |
| 50 |
<input |
| 51 |
type="button" |
| 52 |
class="button-primary insertSlideshowShortcodeSlideshowInsertButton" |
| 53 |
value="<?php _e('Insert Slideshow', 'slideshow-se'); ?>" |
| 54 |
/> |
| 55 |
<input |
| 56 |
type="button" |
| 57 |
class="button insertSlideshowShortcodeCancelButton" |
| 58 |
value="<?php _e('Cancel', 'slideshow-se'); ?>" |
| 59 |
/> |
| 60 |
</td> |
| 61 |
|
| 62 |
</tr> |
| 63 |
</table> |
| 64 |
|
| 65 |
<?php else: ?> |
| 66 |
|
| 67 |
<p> |
| 68 |
<?php echo sprintf( |
| 69 |
__('It seems you haven\'t created any slideshows yet. %1$sYou can create a slideshow here!%2$s', 'slideshow-se'), |
| 70 |
'<a href="' . admin_url('post-new.php?post_type=' . SlideshowSEPluginPostType::$postType) . '" target="_blank">', |
| 71 |
'</a>' |
| 72 |
); ?> |
| 73 |
</p> |
| 74 |
|
| 75 |
<?php endif; ?> |
| 76 |
|
| 77 |
</div> |
| 78 |
</div> |
| 79 |
<?php endif; ?> |