/** * Init Engine */ function init() { // Load Templates include_once 'rc-templates/' . get_html_framework() . '-row-templates.php'; include_once 'rc-templates/' . get_html_framework() . '-col-templates.php'; // Load Modules $includes = array('modules/row-options/row-options.php', 'modules/rich-text/rich-text.php'); // allow developers to add in more modules $includes = array_merge($includes, apply_filters('builder_include_modules', array())); foreach ($includes as $include) { include_once $include; } // Load Builder UI on enabled post types to render builder on $this->enabled_post_types = apply_filters('builder_enabled_post_types', $this->enabled_post_types); // init Builder add_action('dbx_post_sidebar', array($this, 'rednder_builder_ui')); }
/** * 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); }
/** * Last Column Class accoring to framework */ function get_last_column_class() { // Skeleton if ('skt' == get_html_framework()) { return 'omega'; } // Foundation if ('fd3' == get_html_framework()) { return 'end'; } // Others return 'column_last'; }