/** * Shows slides currently in slideshow * * TODO Tidy up, it's probably best to move all to 'slides.php' * * @since 1.0.0 */ static function slidesMetaBox() { global $post; // Get views $views = SlideshowPluginSlideshowSettingsHandler::getViews($post->ID); // Insert slide buttons echo '<p style="text-align: center;"> <i>' . __('Insert', 'slideshow-plugin') . ':</i><br/>' . SlideshowPluginSlideInserter::getImageSlideInsertButton() . SlideshowPluginSlideInserter::getTextSlideInsertButton() . SlideshowPluginSlideInserter::getVideoSlideInsertButton() . '</p>'; // No views/slides message if (count($views) <= 0) { echo '<p>' . __('Add slides to this slideshow by using one of the buttons above.', 'slideshow-plugin') . '</p>'; } // Style echo '<style type="text/css"> .sortable li { cursor: pointer; } .sortable-slide-placeholder { border: 1px solid #f00; } </style>'; // Start list echo '<ul class="sortable-slides-list">'; // Print views if (is_array($views)) { foreach ($views as $view) { if (!$view instanceof SlideshowPluginSlideshowView) { continue; } echo $view->toBackEndHTML(); } } // End list echo '</ul>'; // Templates SlideshowPluginSlideshowSlide::getBackEndTemplates(false); }
<?php $title = $description = $url = $urlTarget = $alternativeText = $noFollow = $postId = ''; $titleElementTag = $descriptionElementTag = SlideshowPluginSlideInserter::getElementTag(); if (isset($properties['title'])) { $title = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['title'])); } if (isset($properties['titleElementTagID'])) { $titleElementTag = SlideshowPluginSlideInserter::getElementTag($properties['titleElementTagID']); } if (isset($properties['description'])) { $description = trim(SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($properties['description'])); } if (isset($properties['descriptionElementTagID'])) { $descriptionElementTag = SlideshowPluginSlideInserter::getElementTag($properties['descriptionElementTagID']); } if (isset($properties['url'])) { $url = htmlspecialchars($properties['url']); } if (isset($properties['urlTarget'])) { $urlTarget = htmlspecialchars($properties['urlTarget']); } if (isset($properties['alternativeText'])) { $alternativeText = htmlspecialchars($properties['alternativeText']); } if (isset($properties['noFollow'])) { $noFollow = ' rel="nofollow" '; } if (isset($properties['postId'])) { $postId = $properties['postId']; }
</div> <div class="slideshow-group"> <div class="slideshow-left slideshow-label"><?php _e('Description', 'slideshow-jquery-image-gallery'); ?> </div> <div class="slideshow-right"> <select name="<?php echo $name; ?> [descriptionElementTagID]"> <?php foreach (SlideshowPluginSlideInserter::getElementTags() as $elementTagID => $elementTag) { ?> <option value="<?php echo $elementTagID; ?> " <?php selected($descriptionElementTagID, $elementTagID); ?> ><?php echo $elementTag; ?> </option> <?php } ?> </select>
/** * Enqueues styles and scripts necessary for the media upload button. * * @since 2.0.0 */ static function enqueueFiles() { // Return if function doesn't exist if (!function_exists('get_current_screen')) { return; } // Return when not on a slideshow edit page, or files have already been included. $currentScreen = get_current_screen(); if ($currentScreen->post_type != SlideshowPluginPostType::$postType || self::$enqueuedFiles) { return; } // Enqueue style wp_enqueue_style('slideshow-slide-inserter', SlideshowPluginMain::getPluginUrl() . '/style/' . __CLASS__ . '/slide-inserter.css', null, SlideshowPluginMain::$version); // Enqueue insert button script wp_enqueue_script('slideshow-slide-inserter', SlideshowPluginMain::getPluginUrl() . '/js/' . __CLASS__ . '/slide-inserter.js', array('jquery'), SlideshowPluginMain::$version); wp_localize_script('slideshow-slide-inserter', 'SlideInserterTranslations', array('confirmMessage' => __('Are you sure you want to delete this slide?', 'slideshow-plugin'))); // Set enqueued to true self::$enqueuedFiles = true; }
<p style="text-align: center;" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"> <i><?php _e('Insert', 'slideshow-plugin'); ?> :</i><br/> <?php echo SlideshowPluginSlideInserter::getImageSlideInsertButton(); ?> <?php echo SlideshowPluginSlideInserter::getTextSlideInsertButton(); ?> <?php echo SlideshowPluginSlideInserter::getVideoSlideInsertButton(); ?> </p> <?php if (count($slides) <= 0) { ?> <p><?php _e('Add slides to this slideshow by using one of the buttons above.', 'slideshow-plugin'); ?> </p> <?php } ?> <style type="text/css"> .sortable li { cursor: pointer;
/** * Shows slides currently in slideshow * * TODO Tidy up, it's probably best to move all to 'slides.php' * * @since 1.0.0 */ static function slidesMetaBox() { global $post; // Get views $views = SlideshowPluginSlideshowSettingsHandler::getViews($post->ID); // Insert slide buttons echo '<p style="text-align: center;"> <i>' . __('Insert', 'slideshow-plugin') . ':</i><br/>' . SlideshowPluginSlideInserter::getImageSlideInsertButton() . SlideshowPluginSlideInserter::getTextSlideInsertButton() . SlideshowPluginSlideInserter::getVideoSlideInsertButton() . '</p>'; // Toggle slides open/closed echo '<p style="text-align: center;"> <a href="#" class="open-slides-button">' . __('Open all', 'slideshow-plugin') . '</a> | <a href="#" class="close-slides-button">' . __('Close all', 'slideshow-plugin') . '</a> </p>'; // No views/slides message if (count($views) <= 0) { echo '<p>' . __('Add slides to this slideshow by using one of the buttons above.', 'slideshow-plugin') . '</p>'; } // Start list echo '<div class="sortable-slides-list">'; // Print views if (is_array($views)) { foreach ($views as $view) { if (!$view instanceof SlideshowPluginSlideshowView) { continue; } echo $view->toBackEndHTML(); } } // End list echo '</div>'; // Templates SlideshowPluginSlideshowSlide::getBackEndTemplates(false); }
/** * Enqueues styles and scripts necessary for the media upload button. * * @since 2.2.12 */ static function localizeScript() { // Return if function doesn't exist if (!function_exists('get_current_screen') || self::$localizedScript) { return; } // Return when not on a slideshow edit page, or files have already been included. $currentScreen = get_current_screen(); if ($currentScreen->post_type != SlideshowPluginPostType::$postType) { return; } wp_localize_script('slideshow-jquery-image-gallery-backend-script', 'slideshow_jquery_image_gallery_backend_script_editSlideshow', array('data' => array(), 'localization' => array('confirm' => __('Are you sure you want to delete this slide?', 'slideshow-plugin'), 'uploaderTitle' => __('Insert image slide', 'slideshow-plugin')))); // Set enqueued to true self::$localizedScript = true; }