ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilProgressBar Class Reference
+ Collaboration diagram for ilProgressBar:

Public Member Functions

 setMin ($a_value)
 Set minimum value.
 setMax ($a_value)
 Set maximum value.
 setCaption ($a_value)
 Set Caption.
 setShowCaption ($a_value)
 Toggle show caption status.
 setStriped ($a_value)
 Toggle striped layout.
 setAnimated ($a_value)
 Toggle animated layout.
 setCurrent ($a_value)
 Set current value.
 render ()
 Render.

Static Public Member Functions

static getInstance ()
 Factory.

Data Fields

const TYPE_INFO = 1
const TYPE_SUCCESS = 2
const TYPE_WARNING = 3
const TYPE_DANGER = 4

Protected Member Functions

 __construct ()
 Constructor.
 setType ($a_value)
 Set type (currently unwanted)

Protected Attributes

 $min
 $max
 $current
 $show_caption
 $type
 $caption
 $striped
 $animated

Detailed Description

Definition at line 11 of file class.ilProgressBar.php.

Constructor & Destructor Documentation

ilProgressBar::__construct ( )
protected

Constructor.

Returns
self

Definition at line 32 of file class.ilProgressBar.php.

References setMax(), setMin(), setShowCaption(), setStriped(), and setType().

{
$this->setMin(0);
$this->setMax(100);
$this->setShowCaption(true);
$this->setType(self::TYPE_INFO);
$this->setStriped(true);
}

+ Here is the call graph for this function:

Member Function Documentation

static ilProgressBar::getInstance ( )
static
ilProgressBar::render ( )

Render.

Returns
string

Definition at line 155 of file class.ilProgressBar.php.

References $tpl.

{
$tpl = new ilTemplate("tpl.il_progress.html", true, true, "Services/UIComponent/ProgressBar");
$tpl->setVariable("MIN", $this->min);
$tpl->setVariable("MAX", $this->max);
$tpl->setVariable("CURRENT_INT", round($this->current));
$tpl->setVariable("CURRENT", round($this->current));
$tpl->setVariable("CAPTION", $this->caption);
$map = array(
self::TYPE_INFO => "info"
,self::TYPE_SUCCESS => "success"
,self::TYPE_WARNING => "warning"
,self::TYPE_DANGER => "danger"
);
$css = array("progress-bar-".$map[$this->type]);
if($this->striped)
{
$css[] = "progress-bar-striped";
}
if($this->animated)
{
$css[] = "active";
}
$tpl->setVariable("CSS", implode(" ", $css));
if(!$this->show_caption)
{
$tpl->touchBlock("hide_caption_in_bl");
$tpl->touchBlock("hide_caption_out_bl");
}
return $tpl->get();
}
ilProgressBar::setAnimated (   $a_value)

Toggle animated layout.

Parameters
bool$a_value

Definition at line 130 of file class.ilProgressBar.php.

{
$this->animated = (bool)$a_value;
}
ilProgressBar::setCaption (   $a_value)

Set Caption.

Parameters
string$a_value

Definition at line 100 of file class.ilProgressBar.php.

{
$this->caption = trim($a_value);
}
ilProgressBar::setCurrent (   $a_value)

Set current value.

Parameters
int | float$a_value

Definition at line 140 of file class.ilProgressBar.php.

{
$this->current = abs($a_value);
}
ilProgressBar::setMax (   $a_value)

Set maximum value.

Parameters
int$a_value

Definition at line 90 of file class.ilProgressBar.php.

Referenced by __construct().

{
$this->max = abs((int)$a_value);
}

+ Here is the caller graph for this function:

ilProgressBar::setMin (   $a_value)

Set minimum value.

Parameters
int$a_value

Definition at line 80 of file class.ilProgressBar.php.

Referenced by __construct().

{
$this->min = abs((int)$a_value);
}

+ Here is the caller graph for this function:

ilProgressBar::setShowCaption (   $a_value)

Toggle show caption status.

Parameters
bool$a_value

Definition at line 110 of file class.ilProgressBar.php.

Referenced by __construct().

{
$this->show_caption = (bool)$a_value;
}

+ Here is the caller graph for this function:

ilProgressBar::setStriped (   $a_value)

Toggle striped layout.

Parameters
bool$a_value

Definition at line 120 of file class.ilProgressBar.php.

Referenced by __construct().

{
$this->striped = (bool)$a_value;
}

+ Here is the caller graph for this function:

ilProgressBar::setType (   $a_value)
protected

Set type (currently unwanted)

Parameters
int$a_value

Definition at line 61 of file class.ilProgressBar.php.

References $valid.

Referenced by __construct().

{
$valid = array(
self::TYPE_INFO
,self::TYPE_SUCCESS
,self::TYPE_WARNING
,self::TYPE_DANGER
);
if(in_array($a_value, $valid))
{
$this->type = $a_value;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilProgressBar::$animated
protected

Definition at line 20 of file class.ilProgressBar.php.

ilProgressBar::$caption
protected

Definition at line 18 of file class.ilProgressBar.php.

ilProgressBar::$current
protected

Definition at line 15 of file class.ilProgressBar.php.

ilProgressBar::$max
protected

Definition at line 14 of file class.ilProgressBar.php.

ilProgressBar::$min
protected

Definition at line 13 of file class.ilProgressBar.php.

ilProgressBar::$show_caption
protected

Definition at line 16 of file class.ilProgressBar.php.

ilProgressBar::$striped
protected

Definition at line 19 of file class.ilProgressBar.php.

ilProgressBar::$type
protected

Definition at line 17 of file class.ilProgressBar.php.

const ilProgressBar::TYPE_DANGER = 4

Definition at line 25 of file class.ilProgressBar.php.

const ilProgressBar::TYPE_INFO = 1

Definition at line 22 of file class.ilProgressBar.php.

const ilProgressBar::TYPE_SUCCESS = 2

Definition at line 23 of file class.ilProgressBar.php.

const ilProgressBar::TYPE_WARNING = 3

Definition at line 24 of file class.ilProgressBar.php.


The documentation for this class was generated from the following file: