Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Integrated the Bootstrap HTML list seamlessly
  • Loading branch information
Gutza committed Feb 18, 2014
1 parent 5c68c50 commit 0ede7df
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
30 changes: 30 additions & 0 deletions include/classes/LPC_HTML_list.php
Expand Up @@ -79,6 +79,11 @@ function getParam($param)

function prepare()
{
if (LPC_HTML_Document::ENV_BOOTSTRAP == $this->ownerDocument->environment) {
$this->addClass("container");
$this->tableClass = "table table-hover";
}

if (!$this->queryObject)
throw new RuntimeException("Query object not specified! (property queryObject)");
if (!is_array($this->sql) || !count($this->sql))
Expand Down Expand Up @@ -434,6 +439,20 @@ function getElementCount()
}

function getIcon($order)
{
$env = $this->ownerDocument->environment;

switch($env) {
case LPC_HTML_Document::ENV_HTML:
return $this->getIconHTML($order);
case LPC_HTML_Document::ENV_BOOTSTRAP:
return $this->getIconconBS($order);
default:
throw new RuntimeException("Unknown environment!");
}
}

function getIconHTML($order)
{
$icon = new LPC_HTML_node("img");
$icon->setAttr('style', 'margin-bottom:-3px;');
Expand All @@ -446,4 +465,15 @@ function getIcon($order)
return $icon;
}

function getIconconBS($order)
{
$icon = new LPC_HTML_node("span");
$icon->setClass("glyphicon")->setAttr("style", "margin-left: 3px");
if ($order == "up")
$icon->addClass("glyphicon-chevron-up");
else
$icon->addClass("glyphicon-chevron-down");

return $icon;
}
}
24 changes: 0 additions & 24 deletions include/classes/LPC_HTML_listBS.php

This file was deleted.

0 comments on commit 0ede7df

Please sign in to comment.