function get_admin_column_class($column) { $class = ''; if (12 == get_grid_columns()) { $class = 'span12'; switch ($column) { case 2: $class = 'span6'; break; case 3: $class = 'span4'; break; case 4: $class = 'span3'; break; case 6: $class = 'span2'; break; } } elseif (16 == get_grid_columns()) { $class = 'span16'; switch ($column) { case 2: $class = 'span8'; break; case 3: $class = 'span1by3'; break; case 4: $class = 'span4'; break; case 8: $class = 'span2'; break; } } return $class; }
/** * Generate column classes */ function builder_column_class(&$prev_width, $col, $extra_class = '') { global $spyropress_builder; $classes = array(); // grid col size class $classes[] = 'span' . str_replace('/', 'by', $col->config['size']); if ('skt' == get_html_framework()) { $classes[] = get_skeleton_class($col->config['size']); } if ('fd3' == get_html_framework()) { $classes[] = get_foundation3_class($col->config['size']); } if ('bs3' == get_html_framework()) { $classes[] = 'col-md-' . $col->config['size']; } // add span_first class $width = is_string($col->config['size']) ? (int) 1 / 3 * 16 : (int) $col->config['size']; $new_width = $prev_width + $width; if ($prev_width == 0) { $classes[] = get_first_column_class(); $prev_width = $new_width; } elseif (get_grid_columns() - $new_width < 0) { $prev_width = $width; $classes[] = get_first_column_class(); } else { $prev_width = $new_width; } if (get_grid_columns() == $new_width) { $prev_width = 0; $classes[] = get_last_column_class(); } // extra class define by row block if ($extra_class != '') { $classes[] = $extra_class; } return spyropress_clean_cssclass($classes); }
/** * Register/Enqueue Admin Styles */ function enqueue_styles() { //Register Styles wp_register_style( $handle, $src, $deps, $ver, $media ) wp_register_style('jquery-aristo', framework_assets_css() . 'aristo/aristo.css', false, get_core_version()); wp_register_style('jquery-plugins', framework_assets_css() . 'spyropress.plugins.css', false, get_core_version()); wp_register_style('spyropress-admin', framework_assets_css() . 'spyropress-admin.css', false, get_core_version()); wp_register_style('spyropress-admin-grid', framework_assets_css() . 'grid-' . get_grid_columns() . 'col.css', false, get_core_version()); wp_enqueue_style('jquery-aristo'); wp_enqueue_style('jquery-plugins'); wp_enqueue_style('spyropress-admin-grid'); wp_enqueue_style('spyropress-admin'); wp_enqueue_style('spyropress-builder'); if (current_theme_supports('spyropress-shortcode-generator')) { wp_enqueue_style('shortcode-popup', framework_assets_css() . 'popup.css', false, '1.0', 'all'); } }