get_view_settings(); //'wpv_column_sort_id' $order_class = 'wpv-header-no-sort'; if ($atts['name'] != 'post-body') { if (isset($_GET['wpv_column_sort_id']) && $_GET['wpv_column_sort_id'] == $atts['name']) { if (isset($_GET['wpv_column_sort_dir'])) { if ($_GET['wpv_column_sort_dir'] == 'asc') { $order_class = 'wpv-header-asc'; } else { $order_class = 'wpv-header-desc'; } } else { // use the default order $order_selected = $view_settings['order']; if ($order_selected == 'ASC') { $order_class = 'wpv-header-asc'; } else { $order_class = 'wpv-header-desc'; } } } if ($order_class == 'wpv-header-asc') { $dir = "desc"; } else { $dir = "asc"; } $link = '' . $value . ''; return $link; } else { return $value; } } add_shortcode('wpv-layout-start', 'wpv_layout_start_shortcode'); function wpv_layout_start_shortcode($atts){ global $WP_Views; // TODO Check Additional JS $view_settings = $WP_Views->get_view_layout_settings(); if (!empty($view_settings['additional_js'])) { $scripts = explode(',', $view_settings['additional_js']); $count = 1; foreach ($scripts as $script) { if (strpos($script, '[theme]') == 0) { $script = str_replace('[theme]', get_stylesheet_directory_uri(), $script); } add_action('wp_footer', create_function('$a=1, $script=\'' . $script. '\'', 'echo "";')); $count++; } } $view_settings = $WP_Views->get_view_settings(); $class = array(); $style = array(); if (($view_settings['pagination'][0] == 'enable' && $view_settings['ajax_pagination'][0] == 'enable') || $view_settings['pagination']['mode'] == 'rollover') { $class[] = 'wpv-pagination'; if (!isset($view_settings['pagination']['preload_images'])) { $view_settings['pagination']['preload_images'] = false; } if (!isset($view_settings['rollover']['preload_images'])) { $view_settings['rollover']['preload_images'] = false; } $class[] = 'wpv-pagination'; if (($view_settings['pagination']['mode'] == 'paged' && $view_settings['pagination']['preload_images']) || ($view_settings['pagination']['mode'] == 'rollover' && $view_settings['rollover']['preload_images'])) { $class[] = 'wpv-pagination-preload-images'; $style[] = 'visibility:hidden;'; } if (($view_settings['pagination']['mode'] == 'paged' && $view_settings['pagination']['preload_pages']) || ($view_settings['pagination']['mode'] == 'rollover' && $view_settings['pagination']['preload_pages'])) { $class[] = 'wpv-pagination-preload-pages'; } $add = ''; if (!empty($class)) { $add .= ' class="' . implode(' ', $class) . '"'; } if (!empty($style)) { $add .= ' style="' . implode(' ', $style) . '"'; } return "