コード例 #1
0
 function addImageColumn($imagePath, $columnClass)
 {
     $div = new html_element("div");
     $div->set('class', 'col-md-6');
     $this->img = new html_element("img");
     $this->img->set('src', $imagePath);
     $div->inject($this->img);
     $this->row->inject($div);
 }
コード例 #2
0
function displayHTML($contentTileArray)
{
    // Sort tiles based on defined order
    uasort($contentTileArray, 'sortByOrder');
    $count = 1;
    foreach ($contentTileArray as $tile) {
        // get the layout for the current tile and render using proper HTML
        switch (intval($tile['layout'])) {
            case 1:
                // Default 2 column layout with with alternating columns.
                $row = new pageTile("contentTile " . $tile['containerClass']);
                if ($count % 2 == 0) {
                    $row->addTextColumn($tile['col1'], "col-md-push-6");
                    $row->addTextColumn($tile['col2'], "col-md-pull-6");
                } else {
                    $row->addTextColumn($tile['col1'], "");
                    $row->addTextColumn($tile['col2'], "");
                }
                echo $row->build();
                break;
            case 2:
                // Image Slider layout
                $row = new pageTile("contentTile " . $tile['containerClass']);
                echo "NOT IMPLEMENTED";
                break;
            case 4:
                // Employee directory display
                $row = new pageTile("contentTile employeeBio");
                $row->addsmTextColumn($tile['col1'], "");
                $row->addsmTextColumn($tile['col2'], "");
                echo $row->build();
                break;
            case 5:
                // Custom Layout, create row and insert col1 data
                $row = new pageTile($tile['containerClass']);
                // REMOVED ." hidden-xs"
                $row->setText($tile['col1']);
                echo $row->build();
                break;
            case 6:
                // Google serch results layout
                $row = new html_element("div");
                $row->set("class", "row");
                $col = new html_element("div");
                $col->set("class", "col-md-12 " . $tile['col12']);
                $col->set("text", $tile['col1']);
                $row->inject($col);
                echo $row->build();
                break;
        }
        $count++;
    }
}