3
* CJuiProgressBar class file.
5
* @author Sebastian Thierer <sebathi@gmail.com>
6
* @link http://www.yiiframework.com/
7
* @copyright Copyright © 2008-2011 Yii Software LLC
8
* @license http://www.yiiframework.com/license/
11
Yii::import('zii.widgets.jui.CJuiWidget');
14
* CJuiProgressBar displays a progress bar widget.
16
* CJuiProgressBar encapsulates the {@link http://jqueryui.com/demos/progressbar/ JUI
17
* Progressbar} plugin.
19
* To use this widget, you may insert the following code in a view:
21
* $this->widget('zii.widgets.jui.CJuiProgressBar', array(
23
* // additional javascript options for the progress bar plugin
25
* 'change'=>'js:function(event, ui) {...}',
27
* 'htmlOptions'=>array(
28
* 'style'=>'height:20px;'
33
* By configuring the {@link options} property, you may specify the options
34
* that need to be passed to the JUI progressbar plugin. Please refer to
35
* the {@link http://jqueryui.com/demos/progressbar/ JUI Progressbar} documentation
36
* for possible options (name-value pairs).
38
* @author Sebastian Thierer <sebathi@gmail.com>
39
* @version $Id: CJuiProgressBar.php 2799 2011-01-01 19:31:13Z qiang.xue $
40
* @package zii.widgets.jui
43
class CJuiProgressBar extends CJuiWidget
46
* @var string the name of the container element that contains the progress bar. Defaults to 'div'.
48
public $tagName = 'div';
50
* @var integer the percentage of the progress. This must be an integer between 0 and 100. Defaults to 0.
56
* This method registers necessary javascript and renders the needed HTML code.
61
if (isset($this->htmlOptions['id']))
62
$id = $this->htmlOptions['id'];
64
$this->htmlOptions['id']=$id;
66
echo CHtml::openTag($this->tagName,$this->htmlOptions);
67
echo CHtml::closeTag($this->tagName);
69
$this->options['value']=$this->value;
70
$options=CJavaScript::encode($this->options);
71
Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').progressbar($options);");
b'\\ No newline at end of file'