Esempio n. 1
0
 /**
  * Render the widget in frontend
  *
  * @param array $args
  * @param array $instance
  * @return string
  */
 function get_widget($args, $instance)
 {
     if (is_admin()) {
         return "<center><i class='icon-th-large  icon-4x'></i></center>";
     }
     $output = "";
     $instance['id'] = $instance['layerslider'];
     $skipSecond = false;
     //check if we got a layerslider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "layerslider";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name}\n                                    WHERE id = " . (int) $instance['layerslider'] . " AND flag_hidden = '0'\n                                    AND flag_deleted = '0'\n                                    ORDER BY date_c DESC LIMIT 1", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['data'], true);
         $height = isset($slides['properties']['height']) ? $slides['properties']['height'] : "";
         $width = isset($slides['properties']['width']) ? $slides['properties']['width'] : "";
         $responsive = isset($slides['properties']['responsive']) ? $slides['properties']['responsive'] : "";
         $responsiveunder = isset($slides['properties']['responsiveunder']) ? $slides['properties']['responsiveunder'] : "";
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "layerslider main_color shadow ";
     $params['open_structure'] = false;
     $params['id'] = "layer_slider";
     $output .= "</div></div></div></div></div></div>";
     //$output .= new_section($params);
     $output .= layerslider_init($instance);
     //$output .= "</div>"; //close section
     //if (empty($skipSecond)) {
     $output .= new_section(array('open_structure' => true, 'open_color_wrap' => false, 'close' => false, 'id' => "after_layerslider"));
     //$output .= new_section(array('close' => false, 'id' => "after_layer_slider"));
     $output .= '<div><div>';
     //}
     return $output;
 }
Esempio n. 2
0
 /**
  * Render the widget in frontend
  *
  * @param array $args
  * @param array $instance
  * @return string
  */
 function get_widget($args, $instance)
 {
     extract(wp_parse_args($instance, array('link' => '', 'link_target' => '', 'caption_title' => '', 'caption_text' => '', 'size' => '', 'size_option' => '1', 'width' => '', 'interval' => '5000')));
     if (is_admin()) {
         return "<center><i class='icon-youtube-play  icon-4x'></i></center>";
     }
     $output = "";
     $class = "";
     if ($size_option == '1') {
         if (cadr_section_class('wrap')) {
             $output .= "</div></div></div></div></div></div></div></div></div></div>";
         } else {
             $output .= "</div></div></div></div></div></div>";
         }
     }
     $use_width = '';
     if ($size_option == '0') {
         //check how large the slider is and change the classname accordingly
         global $_wp_additional_image_sizes;
         $_wp_additional_image_sizes = get_registered_image_sizes(array('thumbnail', 'logo', 'widget', 'slider_thumb'), true);
         $width = 1500;
         if (isset($_wp_additional_image_sizes[$size]['width'])) {
             $width = $_wp_additional_image_sizes[$size]['width'];
         } else {
             if ($size = get_option($size . '_size_w')) {
                 $width = $size;
             }
         }
         if ($width < 600) {
             $class = " small-width-slider";
         }
         if ($width < 305) {
             $class = " super-small-width-slider";
         }
         //$use_width = "style='width:{$width}px'";
         $use_width = "";
     }
     //$size = $size_option == '1'?'full':$size;
     $id = "carousel-slide-" . rand();
     $output .= "\n        <div id='{$id}' class='carousel slide slideshow-{$size} {$class}' {$use_width}>\n            <!-- Indicators -->\n            <ol class='carousel-indicators'>\n            ";
     $i = 0;
     foreach ($slides as $key => $value) {
         $active = $i == 0 ? "class='active'" : '';
         $use_link_target = isset($link_target[$key]) && !empty($link_target[$key]) ? "target='" . $link_target[$key] . "'" : '';
         //$use_link = isset($link[$key]) && is_array($link[$key])?get_url($link[$key]):'#';
         $output .= "<li data-target='#{$id}' data-slide-to='{$i}' {$use_link_target} {$active}></li>";
         $i++;
     }
     $output .= "\n            </ol>\n\n            <!-- Wrapper for slides -->\n            <div class='carousel-inner'>\n        ";
     $i = 0;
     //print_r($size);
     foreach ($slides as $key => $value) {
         $active = $i == 0 ? "active" : '';
         $use_image = "";
         if (isset($image[$key]) && is_array($image[$key])) {
             $img = wp_get_attachment_image_src($image[$key]['id'], $size);
             $img_title = isset($caption_title[$key]) && !empty($caption_title[$key]) ? "{$caption_title[$key]}" : "";
             $use_image = "<img src='{$img[0]}' alt='{$img_title}' width='{$img[1]}' height='{$img[2]}' />";
         }
         //$use_image = isset($image[$key]['url']) && !empty($image[$key]['url'])?"<img alt='' src='".$image[$key]['url']."' />":'';
         $use_caption_title = isset($caption_title[$key]) && !empty($caption_title[$key]) ? "<h3>{$caption_title[$key]}</h3>" : "";
         $use_caption_text = isset($caption_text[$key]) && !empty($caption_text[$key]) ? "<p>{$caption_text[$key]}</p>" : "";
         $output .= "\n                <div class='item {$active}'>\n                    {$use_image}\n                    <div class='carousel-caption'>\n                        {$use_caption_title}\n                        {$use_caption_text}\n                    </div>\n                </div>\n            ";
         $i++;
     }
     $output .= "\n            </div>\n\n            <!-- Controls -->\n            <a class='left carousel-control' href='#{$id}' data-slide='prev'>\n                <span class='icon-prev'></span>\n            </a>\n            <a class='right carousel-control' href='#{$id}' data-slide='next'>\n                <span class='icon-next'></span>\n            </a>\n        </div>    \n        ";
     $use_interval = $interval == 'false' ? 'false' : $interval * 1000;
     $output .= "\n        <script>\n            !function (\$) {\n                \$(function(){\n                    \$('#{$id}').carousel({interval: {$use_interval} });\n                });\n            }(window.jQuery)\n        </script>\n        ";
     if ($size_option == '1') {
         $output .= new_section(array('open_structure' => true, 'open_color_wrap' => false, 'close' => false, 'id' => "after_full_slider"));
         $output .= "<div><div>";
         ?>
         <script type="text/javascript">
             jQuery( document ).ready(function(){
                 
                 jQuery('.slideshow-full_width').css({'width':jQuery( 'body' ).width()});
             });
         </script>
         <?php 
     }
     return $output;
 }
Esempio n. 3
0
function redux_render_layout($layout, $id, $holder = '')
{
    $html = '';
    $redux_options = get_option("wpeden_admin");
    $gs = get_post_meta(get_the_ID(), 'redux_grid_settings', true);
    $gs = $gs[$holder . "_rows"];
    //$_testing = redux_render_layout_prepare($gs);
    //$container_css = "bs_row-fluid";
    //$layout_folder = "bootstrap";
    $container_css = "container_12";
    $layout_folder = "bootstrap";
    global $redux_layout_data, $redux_layout_settings;
    if (!$redux_layout_settings) {
        $redux_layout_settings = get_option('redux_layout_settings', array());
    }
    if (in_array($holder, get_post_types())) {
        $redux_page_layout_settings = get_post_meta(get_the_ID(), 'redux_layout_settings', true);
        $ls = unserialize(base64_decode($redux_page_layout_settings[$holder][$layout][$id]));
    } else {
        $ls = unserialize(base64_decode($redux_layout_settings[$holder][$layout][$id]));
    }
    //print_r($ls);die("hhh");
    //$rid = $ls['css_id'] ? $ls['css_id'] : "row_{$id}";
    $rid = "row_{$id}";
    $defaults = array('custom_section' => '0', 'custom_choice' => '', 'custom_bg' => '', 'position' => '', 'repeat' => '', 'attach' => '', 'padding' => '', 'margin' => '', 'shadow' => '', 'close' => true, 'open' => true);
    $ls = wp_parse_args($ls, $defaults);
    if ($ls['custom_section'] == '1') {
        $class = "  section-" . $ls['shadow'];
        $background = "";
        $padding = "";
        $margin = "";
        $output = "";
        if (isset($ls['src']['url']) && !empty($ls['src']['url'])) {
            if ($ls['repeat'] == 'stretch') {
                $background .= "background-repeat: no-repeat; ";
                $class .= " section-full-stretch";
            } else {
                $background .= "background-repeat: " . $ls['repeat'] . "; ";
            }
            $img = wp_get_attachment_image_src($ls['src']['id'], 'extra_full_width');
            $background .= "background-image: url(" . $img[0] . "); ";
            $background .= "background-attachment: " . $ls['attach'] . "; ";
            $background .= "background-position: " . $ls['position'] . "; ";
        }
        if (isset($ls['margin']['units']) && !empty($ls['margin']['units'])) {
            $margin .= "margin-top: " . $ls['margin']['margin-top'] . "; ";
            $margin .= "margin-right: " . $ls['margin']['margin-right'] . "; ";
            $margin .= "margin-bottom: " . $ls['margin']['margin-bottom'] . "; ";
            $margin .= "margin-left: " . $ls['margin']['margin-left'] . "; ";
        }
        if (isset($ls['padding']['units']) && !empty($ls['padding']['units'])) {
            $padding .= "padding-top: " . $ls['padding']['padding-top'] . "; ";
            $padding .= "padding-right: " . $ls['padding']['padding-right'] . "; ";
            $padding .= "padding-bottom: " . $ls['padding']['padding-bottom'] . "; ";
            $padding .= "padding-left: " . $ls['padding']['padding-left'] . "; ";
        }
        //if custom bg color set && user enabled custom bg color , then ignore custom bg image
        if ($ls['custom_bg'] != "" && $ls['custom_choice'] == '1') {
            $background = "background-color: " . $ls['custom_bg'] . "; ";
        }
        if ($background || $padding || $margin) {
            $background = "style = '{$background} {$padding} {$margin}'";
        }
        //echo($background);
        $params['class'] = $class;
        $params['bg'] = $background;
        //echo "ssss";
        $html .= new_section($params);
        ///echo $html;
        //echo "ssss";
        //die();
    }
    $html .= '<div class="row section_area">';
    $cols = count($gs[$id]);
    $cols = $cols ? $cols : 2;
    $grid = (int) (12 / $cols);
    $rem = 12 % $cols;
    for ($i = 1; $i <= $cols; $i++) {
        if ($i == $cols) {
            $grid += $rem;
        }
        if ($gs[$id]) {
            $grid = $gs[$id]['grid_' . $i];
        }
        $html .= "<div class='col-md-{$grid} redux_column' id='column_{$i}_{$id}'>";
        $html .= redux_render_mobules("column_{$i}_{$id}");
        $html .= "</div>";
    }
    $html .= '</div>';
    if ($ls['custom_section'] == '1') {
        $skipSecond = '';
        if (empty($skipSecond)) {
            $new_params['id'] = "after_section";
            $html .= new_section($new_params);
        }
    }
    return $html;
}
Esempio n. 4
0
    set_section('added', $_SESSION['course'], $_SESSION['dept'], $_POST['section'], $_SESSION['year'], $_SESSION['season']);
}
if (isset($_POST['new'])) {
    //add this new section.
    //if we have discussion and lab, let's input that.
    if (isset($_POST['day1']) && isset($_POST['day2'])) {
        new_section($_POST['crn'], $_SESSION['dept'], $_SESSION['course'], $_POST['addingsection'], $_SESSION['year'], $_SESSION['season'], $_POST['day'], $_POST['lecturestart'], $_POST['lectureend'], $_POST['day1'], $_POST['discstart'], $_POST['discend'], $_POST['day2'], $_POST['labstart'], $_POST['labend']);
    } else {
        if (isset($_POST['day1'])) {
            new_section($_POST['crn'], $_SESSION['dept'], $_SESSION['course'], $_POST['addingsection'], $_SESSION['year'], $_SESSION['season'], $_POST['day'], $_POST['lecturestart'], $_POST['lectureend'], $_POST['day1'], $_POST['discstart'], $_POST['discend']);
        } else {
            if (isset($_POST['day2'])) {
                new_section($_POST['crn'], $_SESSION['dept'], $_SESSION['course'], $_POST['addingsection'], $_SESSION['year'], $_SESSION['season'], $_POST['day'], $_POST['lecturestart'], $_POST['lectureend'], $_POST['day2'], $_POST['labstart'], $_POST['labend']);
            } else {
                //just lecture
                new_section($_POST['crn'], $_SESSION['dept'], $_SESSION['course'], $_POST['addingsection'], $_SESSION['year'], $_SESSION['season'], $_POST['day'], $_POST['lecturestart'], $_POST['lectureend']);
            }
        }
    }
}
staffheader($_SESSION['name'], "mansection.php", $_SESSION['year'], $_SESSION['season_name'], $_SESSION['season']);
?>

<br><br><br>

<p style="text-align:center">
<fieldset class="scheduler-border" style="border-color:#3BA4C7; width: 80%; text-align: center; margin-left: 10%; margin-right: 10%">
<legend><b>Section Management:</b></legend>
<input type="button" onClick="parent.location='mancourse.php'" value="Back to Courses">
        <p>This page can be used to manage the sections offered for <b>
<?php