Ejemplo n.º 1
0
 function modify_arguments($args = false)
 {
     /* Grid Settings Defaults */
     $this->inputs['setup']['column-width']['default'] = HeadwayWrappers::$default_column_width;
     $this->inputs['setup']['gutter-width']['default'] = HeadwayWrappers::$default_gutter_width;
     /* End Grid Settings Defaults */
     /* Margins */
     $wrapper_instance_id = $args['wrapper']['id'] . '-layout-' . $args['wrapper']['layout'];
     $this->inputs['setup']['wrapper-margin-top']['value'] = HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'margin-top', HeadwayWrappers::$default_wrapper_margin_top, 'structure');
     $this->inputs['setup']['wrapper-margin-bottom']['value'] = HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'margin-bottom', HeadwayWrappers::$default_wrapper_margin_bottom, 'structure');
     /* End Margins */
 }
Ejemplo n.º 2
0
    static function wrapper()
    {
        $layout_id = headway_get('layout-in-use');
        $wrappers = HeadwayWrappers::get_layout_wrappers($layout_id);
        $return = '';
        /* Default Wrapper Margins */
        if (headway_get('file') == 've-iframe-grid-dynamic' && headway_get('visual-editor-open')) {
            $return .= HeadwayElementProperties::output_css('div.wrapper', array('margin-top' => HeadwayElementsData::get_property('wrapper', 'margin-top', HeadwayWrappers::$default_wrapper_margin_top, 'structure'), 'margin-bottom' => HeadwayElementsData::get_property('wrapper', 'margin-bottom', HeadwayWrappers::$default_wrapper_margin_bottom, 'structure'), 'padding-top' => HeadwayElementsData::get_property('wrapper', 'padding-top', null, 'structure'), 'padding-right' => HeadwayElementsData::get_property('wrapper', 'padding-right', null, 'structure'), 'padding-bottom' => HeadwayElementsData::get_property('wrapper', 'padding-bottom', null, 'structure'), 'padding-left' => HeadwayElementsData::get_property('wrapper', 'padding-left', null, 'structure')));
        }
        /* Wrappers for Layout */
        foreach ($wrappers as $wrapper_id => $wrapper_settings) {
            $wrapper_grid_width = HeadwayWrappers::get_grid_width($wrapper_settings);
            /* Set up variables for wrapper */
            $wrapper_selector = 'div#' . $wrapper_id;
            /* Fixed Wrapper */
            if (!$wrapper_settings['fluid']) {
                /* Wrapper */
                $return .= $wrapper_selector . ' {
							width: ' . $wrapper_grid_width . 'px;
						}';
                if (HeadwayResponsiveGrid::is_enabled()) {
                    $return .= $wrapper_selector . '.responsive-grid {
								width: auto !important;
								max-width: ' . $wrapper_grid_width . 'px;
							}';
                }
                /* Grid */
                if (headway_get('file') != 've-iframe-grid-dynamic' || !headway_get('visual-editor-open')) {
                    $return .= HeadwayResponsiveGrid::is_enabled() ? self::responsive_grid($wrapper_settings) : self::fixed_grid($wrapper_settings);
                }
                /* Fluid Wrapper */
            } else {
                /* Grid Container */
                /* Fixed Grid */
                if (!$wrapper_settings['fluid-grid']) {
                    $return .= $wrapper_selector . ' div.grid-container {
									width: ' . $wrapper_grid_width . 'px;
								}';
                    if (HeadwayResponsiveGrid::is_enabled()) {
                        $return .= $wrapper_selector . '.responsive-grid div.grid-container {
										width: auto !important;
										max-width: ' . $wrapper_grid_width . 'px;
									}';
                    }
                }
                /* Grid */
                if (headway_get('file') != 've-iframe-grid-dynamic' || !headway_get('visual-editor-open')) {
                    $return .= HeadwayResponsiveGrid::is_enabled() || $wrapper_settings['fluid-grid'] ? self::responsive_grid($wrapper_settings) : self::fixed_grid($wrapper_settings);
                }
            }
            /* Both Fixed and Fluid: Margin in Grid Mode */
            if (headway_get('file') == 've-iframe-grid-dynamic' && headway_get('visual-editor-open')) {
                $wrapper_instance_id = $wrapper_settings['id'] . '-layout-' . $wrapper_settings['layout'];
                $return .= HeadwayElementProperties::output_css($wrapper_selector, array('margin-top' => HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'margin-top', null, 'structure'), 'margin-bottom' => HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'margin-bottom', null, 'structure'), 'padding-top' => HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'padding-top', null, 'structure'), 'padding-right' => HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'padding-right', null, 'structure'), 'padding-bottom' => HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'padding-bottom', null, 'structure'), 'padding-left' => HeadwayElementsData::get_special_element_property('wrapper', 'instance', $wrapper_instance_id, 'padding-left', null, 'structure')));
            }
        }
        return $return;
    }