示例#1
0
文件: gallery.php 项目: alysilv/sila
function st_gallery_settings_box_content($post)
{
    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'st_gallery_noncename');
    $meta_name = '_st_gallery';
    $values = get_post_meta($post->ID, $meta_name, true);
    ?>
 <div class="stpb_pd_w thumbnail_images gallery-builder">
    <?php 
    stpb_images($meta_name, $values);
    ?>
    
   <div style="clear: both;"></div>
  </div><!-- stpb_pd_w -->
 <?php 
}
示例#2
0
function st_builder_meta_page_slider($name = '', $values = array(), $post = false)
{
    if (!in_array($post->post_type, array('page', 'event', 'room', 'portfolio'))) {
        return;
    }
    if ($values['slider_type'] == '') {
        $values['slider_type'] = 'titlebar';
        $values['slider_full_w'] = 1;
    }
    $layersliders = $revsliders = array();
    $slider_types = array('layerslider' => "Layer slider", 'revslider' => 'Revolution Slider', 'flexslider' => 'Flex Slider', 'titlebar' => 'Titlebar', 'statichtml' => 'HTML code');
    ?>
  
      <div class="stdive"></div>
         <?php 
    /// for Layer Slider
    if (function_exists('layerslider_router')) {
        // if layerSlider installeds
        // Get WPDB Object
        global $wpdb;
        // Get sliders
        $layersliders = $wpdb->get_results("SELECT * FROM  {$wpdb->prefix}layerslider WHERE flag_hidden = '0' AND flag_deleted = '0'\n                ORDER BY date_c ASC ");
    } else {
        unset($slider_types['layerslider']);
    }
    if (class_exists('UniteFunctionsWPRev')) {
        $revsliders = $wpdb->get_results("SELECT `title`, `alias`  FROM {$wpdb->prefix}revslider_sliders ORDER BY `title` ASC ");
    } else {
        unset($slider_types['revslider']);
    }
    ?>
            
             <div class="show_top_slider">
                <h4><?php 
    _e('Show top Element', 'smooththemes');
    ?>
<small> (<?php 
    _e('Enable top slider, titbar or html code', 'smooththemes');
    ?>
)</small></h4>
                <input type="checkbox"  class="show_top_slider_ibutton show_top_slider" name="<?php 
    echo $name . '[show_top_slider]';
    ?>
" <?php 
    echo $values['show_top_slider'] == 1 ? '  checked="checked" ' : '';
    ?>
 value="1" />
            </div>
            
            <div class="slider-types" <?php 
    echo $values['show_top_slider'] == 1 ? '' : ' style="display: none;" ';
    ?>
>
                <h4><?php 
    _e('Element type', 'smooththemes');
    ?>
</h4>
                <select name="<?php 
    echo $name . '[slider_type]';
    ?>
"  class="st-slider-type chzn-select" >
                     <?php 
    if ($values['slider_type'] == '') {
        $values['slider_type'] = 'layerslider';
    }
    foreach ($slider_types as $k => $s) {
        $selected = '';
        if ($values['slider_type'] == $k) {
            $selected = ' selected ="selected" ';
        }
        ?>
                     <option value="<?php 
        echo esc_attr($k);
        ?>
" <?php 
        echo $selected;
        ?>
 ><?php 
        echo esc_html(stripslashes($s));
        ?>
</option>
                     <?php 
    }
    ?>
                </select>
            </div>
            
            
             <div class="st-revslider st-slider-data" <?php 
    echo $values['slider_type'] == 'revslider' && $values['show_top_slider'] == 1 ? '' : ' style="display: none;" ';
    ?>
>
             <h4><?php 
    _e('Revolution Slider', 'smooththemes');
    ?>
</h4>
                <select name="<?php 
    echo $name . '[revslider]';
    ?>
"  class="chzn-select" >
                <?php 
    foreach ($revsliders as $s) {
        $selected = "";
        $k = $s->alias;
        if ($values['revslider'] == $k) {
            $selected = ' selected ="selected" ';
        }
        ?>
                     <option value="<?php 
        echo esc_attr($k);
        ?>
" <?php 
        echo $selected;
        ?>
 ><?php 
        echo esc_html(stripslashes($s->title));
        ?>
</option>
                     <?php 
    }
    ?>
                </select>
                <p><a href="<?php 
    echo admin_url('admin.php?page=revslider');
    ?>
"><?php 
    _e('Add New Revolution Slider', 'smooththemes');
    ?>
</a></p>
            </div>
            
            <div class="st-statichtml st-slider-data" <?php 
    echo $values['slider_type'] == 'statichtml' && $values['show_top_slider'] == 1 ? '' : ' style="display: none;" ';
    ?>
>
                 <h4>HTML code</h4>
                 <textarea style="width: 80%;" rows="10" name="<?php 
    echo $name . '[statichtml]';
    ?>
"><?php 
    echo esc_attr($values['statichtml']);
    ?>
</textarea>
            </div>
            
            <div class="st-layerslider st-slider-data" <?php 
    echo $values['slider_type'] == 'layerslider' && $values['show_top_slider'] == 1 ? '' : ' style="display: none;" ';
    ?>
>
             <h4><?php 
    _e('Layer Slider', 'smooththemes');
    ?>
</h4>
                <select name="<?php 
    echo $name . '[layerslider]';
    ?>
"  class="chzn-select" >
                <?php 
    foreach ($layersliders as $s) {
        $selected = "";
        //  $k = "[layerslider id=\"{$s->id}\"]";
        $k = $s->id;
        if ($values['layerslider'] == $k) {
            $selected = ' selected ="selected" ';
        }
        ?>
                     <option value="<?php 
        echo esc_attr($k);
        ?>
" <?php 
        echo $selected;
        ?>
 ><?php 
        echo esc_html(stripslashes($s->name));
        ?>
</option>
                     <?php 
    }
    ?>
                </select>
                <p><a href="<?php 
    echo admin_url('dmin.php?page=layerslider');
    ?>
"><?php 
    _e('Add New Layerslider', 'smooththemes');
    ?>
</a></p>
            </div>
            
            
            <?php 
    if (!isset($values['slider_data']) || empty($values['slider_data'])) {
        $values['slider_data'] = array('cats' => array());
    }
    if (!isset($values['slider_data']['cats'])) {
        $values['slider_data']['cats'] = array();
    }
    if (!is_array($values['slider_data']['cats'])) {
        $values['slider_data']['cats'] = (array) $values['slider_data']['cats'];
    }
    ?>
            <div class="st-elasticslideshow st-nivo st-flexslider st-slider-data thumbnail_images gallery-builder " <?php 
    echo $values['show_top_slider'] == 1 && isset($values['slider_type']) && !in_array($values['slider_type'], array('layerslider', 'revslider', 'titlebar', 'statichtml')) ? '' : ' style="display: none;" ';
    ?>
>
                  <?php 
    stpb_images($name . '[slider_items]', $values['slider_items']);
    ?>
            </div>
            
            <div class="st-slider-data st-titlebar" <?php 
    echo $values['slider_type'] == 'titlebar' && $values['show_top_slider'] == 1 ? '' : ' style="display: none;" ';
    ?>
>
                <?php 
    if (!isset($values['titlebar']) || empty($values['titlebar'])) {
        $values['titlebar'] = array('title' => '', 'desc' => '', 'img' => '');
    }
    ?>
               <div class="tag_line">
                      <h4><?php 
    echo _e("Titlebar title", 'smooththemes');
    ?>
</h4>
                    <label>
                    <input type="text" class="regular-text"  name="<?php 
    echo $name . '[titlebar][title]';
    ?>
" value="<?php 
    echo esc_attr($values['titlebar']['title']);
    ?>
" />
                    </label>
                </div>
                
                <div class="tag_line">
                      <h4><?php 
    echo _e("Titlebar description", 'smooththemes');
    ?>
</h4>
                    <label>
                    <input type="text" class="regular-text"  name="<?php 
    echo $name . '[titlebar][desc]';
    ?>
" value="<?php 
    echo esc_attr($values['titlebar']['desc']);
    ?>
" />
                    </label>
                </div>
                
              
                 <div class="pb-box-upload ui-img-w item-gr">
                    <h4><?php 
    echo _e("Titlebar background image", 'smooththemes');
    ?>
</h4>
            		<input type="text" value="<?php 
    echo esc_attr($values['titlebar']['img']);
    ?>
" name="<?php 
    echo $name . '[titlebar][img]';
    ?>
" class="group-name pb-input-upload" >
                    <a href="#"  class="pb-upload-button button-secondary"><span></span><?php 
    echo __('Select Image', 'smooththemes');
    ?>
</a>
                    <a href="#" class="remove_image button-secondary"><span></span><?php 
    echo __('Remove', 'smooththemes');
    ?>
</a>
                    <div class="clear"></div>
                </div>
           
           </div>  

             <div class="st-elasticslideshow st-titlebar st-nivo st-flexslider st-slider-data thumbnail_images gallery-builder  st-statichtml" <?php 
    echo $values['show_top_slider'] == 1 && isset($values['slider_type']) && !in_array($values['slider_type'], array('layerslider', 'revslider')) ? '' : ' style="display: none;" ';
    ?>
>
             <h4><?php 
    _e('Element full with', 'smooththemes');
    ?>
</h4>
                <input type="checkbox"  class="ibutton" name="<?php 
    echo $name . '[slider_full_w]';
    ?>
" <?php 
    echo $values['slider_full_w'] == 1 ? '  checked="checked" ' : '';
    ?>
 value="1" />
             </div>
             
           
           
                      
  <?php 
}