Exemplo n.º 1
0
    public static function display_grid_blocks($blocks, $wrapper)
    {
        echo '<div class="grid-container">';
        if (is_array($blocks)) {
            foreach ($blocks as $block_id => $block) {
                HeadwayBlocks::display_block($block, 'grid');
            }
        }
        /* Mirrored wrapper notice */
        $mirror_wrapper_id = HeadwayWrappers::format_wrapper_id(headway_get('mirror-wrapper', $wrapper));
        $mirror_wrapper = $mirror_wrapper_id ? HeadwayWrappers::get_wrapper($mirror_wrapper_id) : null;
        $mirror_wrapper_layout = $mirror_wrapper ? HeadwayLayout::get_name(headway_get('layout', $mirror_wrapper)) : null;
        $mirror_wrapper_alias = headway_get('alias', $mirror_wrapper) ? '(' . headway_get('alias', $mirror_wrapper) . ')' : null;
        echo '<div class="wrapper-mirror-notice">
						<div>
						<h2>Wrapper Mirrored</h2>
						<p>This wrapper is mirroring the blocks from Wrapper #<span class="wrapper-mirror-notice-id">' . $mirror_wrapper_id . '</span> <span class="wrapper-mirror-notice-alias">' . $mirror_wrapper_alias . '</span> <span class="wrapper-mirror-notice-layout">from "' . $mirror_wrapper_layout . '" layout</span></p>
						<small>Mirroring can be disabled via Wrapper Options in the right-click menu</small>
						</div>
					</div><!-- .wrapper-mirror-notice -->';
        /* End mirrored wrapper notice */
        echo '</div><!-- .grid-container -->';
    }
Exemplo n.º 2
0
 public function render_grid()
 {
     $this->process();
     echo '<div class="grid-container clearfix">' . "\n";
     do_action('headway_grid_container_open', $this->wrapper);
     foreach ($this->finalized_layout as $row_index => $row) {
         echo '<section class="' . implode(' ', array_unique(array_filter($row['classes']))) . '">' . "\n";
         do_action('headway_block_row_open', $this->wrapper);
         foreach ($row['columns'] as $column_index => $column) {
             echo '<section class="' . implode(' ', array_unique(array_filter($column['classes']))) . '">' . "\n";
             do_action('headway_block_column_open', $this->wrapper);
             foreach ($column['contents'] as $index => $block_or_sub_column) {
                 if (headway_get('type', $block_or_sub_column) == 'block') {
                     HeadwayBlocks::display_block(headway_get('block', $block_or_sub_column), 'grid-renderer');
                 } elseif (headway_get('type', $block_or_sub_column) == 'sub-column') {
                     echo '<section class="' . implode(' ', array_unique(array_filter($block_or_sub_column['classes']))) . '">';
                     do_action('headway_block_sub_column_open', $this->wrapper);
                     foreach ($block_or_sub_column['blocks'] as $sub_block) {
                         HeadwayBlocks::display_block($sub_block, 'grid-renderer');
                     }
                     do_action('headway_block_sub_column_column', $this->wrapper);
                     echo '</section><!-- .sub-column -->';
                 }
             }
             do_action('headway_block_column_close', $this->wrapper);
             echo '</section><!-- .column -->';
         }
         do_action('headway_block_row_close', $this->wrapper);
         echo '</section><!-- .row -->' . "\n\n";
     }
     do_action('headway_grid_container_close', $this->wrapper);
     echo '</div><!-- .grid-container -->' . "\n\n";
 }