public function validateUser()
 {
     if (!isset($_SESSION['usuario'])) {
         print 'No tienes permisos para estar aqui';
         $button = new html_element('a');
         $button->set('href', '/index/login');
         $button->set('text', 'Click here!');
         $button->output();
         die;
     }
 }
예제 #2
0
 public function addElement($text, $value, $type = '', $id = '', $class = '')
 {
     $label = new html_element('label');
     $label->set('text', $this->clean($text));
     $element = new html_element('input');
     $element->set('id', $id);
     $element->set('class', $class);
     $element->set('value', $value);
     if ($type != '') {
         $element->set('type', $type);
     }
     $this->form .= $label->build() . $element->build();
 }
예제 #3
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);
 }
예제 #4
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++;
    }
}