/** * PageLines Body Classes * * Sets up classes for controlling design and layout and is used on the body tag * * @package PageLines Framework * @subpackage Functions Library * * @since 1.1.0 * * @link http://www.pagelines.com/wiki/Pagelines_body_classes * * @uses ploption * @uses PL_CHILDTHEMENAME (constant) * * @return string $body_classes - PageLines default body classes */ function pagelines_body_classes() { global $pagelines_template; $special_body_class = ploption('special_body_class') ? ploption('special_body_class') : ''; $canvas_shadow = ploption('canvas_shadow') ? 'content-shadow' : ''; $responsive = ploption('layout_handling') == 'pixels' || ploption('layout_handling') == 'percent' ? 'responsive' : 'static'; $design_mode = ploption('site_design_mode') && !pl_is_disabled('color_control') ? ploption('site_design_mode') : 'full_width'; $body_classes = sprintf('custom %s %s %s %s %s %s', $canvas_shadow, $responsive, strtolower(PL_CHILDTHEMENAME), $pagelines_template->template_type, $design_mode, $special_body_class); global $pagelines_addclasses; if (isset($pagelines_addclasses)) { $body_classes .= sprintf(' %s', $pagelines_addclasses); } return $body_classes; }
/** * * @TODO do * */ function pagelines_supersize_bg() { global $pagelines_ID; $oset = array('post_id' => $pagelines_ID); $url = ploption('page_background_image_url', $oset); if (ploption('supersize_bg') && $url && !pl_is_disabled('color_control')) { wp_enqueue_script('pagelines-supersize'); add_action('wp_head', 'pagelines_runtime_supersize', 20); } }
/** * * @TODO document * */ function get_layout_inline() { $l = $this->calculate_dimensions($this->layout_mode); $mode = '.' . $this->layout_mode . ' '; $css = ''; $c = $this->content->width; $p = $this->content->percent; // Selectors // Setup Page Width $page_width_array = apply_filters('pl_page_width', array('body.fixed_width #page', 'body.fixed_width #footer', 'body.canvas .page-canvas')); $page_width_sel = join(',', $page_width_array); // Setup Content Width $content_width_array = apply_filters('pl_content_width', array('#site .content', '#footer .content')); $content_width_sel = join(',', $content_width_array); // Options $layout_handling = ploption('layout_handling'); $design_mode = ploption('site_design_mode'); $contained = $design_mode == 'fixed_width' && !pl_is_disabled('color_control') ? true : false; // Set CSS for content and page width if ($layout_handling == 'percent') { if ($contained) { $css .= sprintf($page_width_sel . '{ width: %s%%;}', $p); $css .= sprintf($content_width_sel . '{ width: %s%%; }', '100'); } else { $css .= sprintf($content_width_sel . '{ width: %s%%; }', $p); } } elseif ($layout_handling == 'pixels') { $css .= sprintf($page_width_sel . '{ max-width:%spx; }', $c); $css .= sprintf($content_width_sel . '{ width: 100%%; max-width:%spx;}', $c); } else { $css .= sprintf($page_width_sel . '{ max-width:%spx; }', $c); $css .= sprintf($content_width_sel . '{ width:%spx;}', $c); } // Set CSS for inner elements based on mode $content_id = apply_filters('pl_content_id', '#pagelines_content'); $main_col_id = apply_filters('pl_main_id', '#column-main'); foreach (get_the_layouts() as $mode) { $l = $this->calculate_dimensions($mode); $mode_selector = '.' . $mode; $css .= sprintf('%1$s %3$s %4$s{ %2$s }', $mode_selector, $l['main'], $content_id, $main_col_id); $css .= sprintf('%1$s %3$s #sidebar1{ %2$s }', $mode_selector, $l['sb1'], $content_id); $css .= sprintf('%1$s %3$s #sidebar2{ %2$s }', $mode_selector, $l['sb2'], $content_id); $css .= sprintf('%1$s %3$s #column-wrap{ %2$s }', $mode_selector, $l['colwrap'], $content_id); $css .= sprintf('%1$s %3$s #sidebar-wrap{ %2$s }', $mode_selector, $l['sbwrap'], $content_id); } return $css; }