예제 #1
0
 public static function admin_enqueue_scripts()
 {
     self::wp_enqueue_scripts();
     // Enqueue all transition scripts for live preview.
     foreach (TpsOptions::getTransitionEffects() as $key => $value) {
         self::enqueueTransition($key);
     }
     // CSS, even if there is no theme, so we can change the path via JS.
     if (TpsOptions::get('theme') == 'none') {
         wp_register_style('theiaPostSlider', TPS_PLUGINS_URL . 'css/' . TpsOptions::get('theme'), TPS_VERSION);
         wp_enqueue_style('theiaPostSlider');
     }
     // Admin CSS
     wp_register_style('theiaPostSlider-admin', TPS_PLUGINS_URL . 'css/admin.css', TPS_VERSION);
     wp_enqueue_style('theiaPostSlider-admin');
 }
예제 #2
0
    public static function do_page()
    {
        $tabs = array('general' => array('title' => __("General", 'theia-post-slider'), 'class' => 'General'), 'navigationBar' => array('title' => __("Navigation Bar", 'theia-post-slider'), 'class' => 'NavigationBar'));
        if (array_key_exists('tab', $_GET) && array_key_exists($_GET['tab'], $tabs)) {
            $currentTab = $_GET['tab'];
        } else {
            $currentTab = 'general';
        }
        ?>

		<div class="wrap" xmlns="http://www.w3.org/1999/html">
			<div id="icon-options-general" class="icon32"><br></div>
			<h2>Theia Post Slider</h2>
			<?php 
        settings_errors();
        ?>
			<h2 class="nav-tab-wrapper">
				<?php 
        foreach ($tabs as $id => $tab) {
            $class = 'nav-tab';
            if ($id == $currentTab) {
                $class .= ' nav-tab-active';
            }
            ?>
				    <a href="?page=tps&tab=<?php 
            echo $id;
            ?>
" class="<?php 
            echo $class;
            ?>
"><?php 
            echo $tab['title'];
            ?>
</a>
				    <?php 
        }
        ?>
			</h2>
			<?php 
        $class = 'TpsAdmin_' . $tabs[$currentTab]['class'];
        require $class . '.php';
        $page = new $class();
        $page->echoPage();
        ?>

			<h3><?php 
        _e("Live Preview", 'theia-post-slider');
        ?>
</h3>
			<div class="theiaPostSlider_adminPreview">
				<?php 
        echo TpsMisc::getNavigationBar(array('currentSlide' => 1, 'totalSlides' => 3, 'id' => 'tps_nav_upper', 'class' => '_upper', 'style' => in_array(TpsOptions::get('nav_vertical_position'), array('top_and_bottom', 'top')) ? '' : 'display: none'));
        ?>
				<div id="tps_dest" class="theiaPostSlider_slides"></div>
				<div id="tps_src" class="theiaPostSlider_slides">
					<?php 
        include dirname(__FILE__) . '/preview-slider.php';
        ?>
				</div>
				<?php 
        echo TpsMisc::getNavigationBar(array('currentSlide' => 1, 'totalSlides' => 3, 'id' => 'tps_nav_lower', 'class' => '_lower', 'style' => in_array(TpsOptions::get('nav_vertical_position'), array('top_and_bottom', 'bottom')) ? '' : 'display: none'));
        $sliderOptions = array('src' => '#tps_src > div', 'dest' => '#tps_dest', 'nav' => array('#tps_nav_upper', '#tps_nav_lower'), 'navText' => TpsOptions::get('navigation_text'), 'helperText' => TpsOptions::get('helper_text'), 'transitionEffect' => TpsOptions::get('transition_effect'), 'transitionSpeed' => TpsOptions::get('transition_speed'), 'keyboardShortcuts' => true, 'prevText' => TpsOptions::get('prev_text'), 'nextText' => TpsOptions::get('next_text'), 'buttonWidth' => TpsOptions::get('button_width'));
        ?>
				<script type='text/javascript'>
					var slider, theme;
					jQuery(document).ready(function() {
						slider = new tps.createSlideshow(<?php 
        echo json_encode($sliderOptions);
        ?>
);
					});
				</script>
			</div>
		</div>
		<?php 
    }
예제 #3
0
 public static function getPrevNextPost($previous)
 {
     if (!TpsOptions::get('post_navigation')) {
         return null;
     }
     $post = get_adjacent_post(TpsOptions::get('post_navigation_same_category'), '', $previous);
     if (!$post) {
         return null;
     }
     return $post->ID;
 }