1 <?php
2 /**
3 * TbListView class file.
4 * @author Christoffer Niska <ChristofferNiska@gmail.com>
5 * @copyright Copyright © Christoffer Niska 2011-
6 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
7 * @package bootstrap.widgets
8 */
9
10 Yii::import('zii.widgets.CListView');
11
12 /**
13 * Bootstrap Zii list view.
14 */
15 class TbListView extends CListView
16 {
17 /**
18 * @var string the CSS class name for the pager container. Defaults to 'pagination'.
19 */
20 public $pagerCssClass = 'pagination';
21 /**
22 * @var array the configuration for the pager.
23 * Defaults to <code>array('class'=>'ext.bootstrap.widgets.TbPager')</code>.
24 */
25 public $pager = array('class'=>'bootstrap.widgets.TbPager');
26 /**
27 * @var string the URL of the CSS file used by this detail view.
28 * Defaults to false, meaning that no CSS will be included.
29 */
30 public $cssFile = false;
31
32 /**
33 * Initializes the widget.
34 */
35 public function init()
36 {
37 parent::init();
38
39 $popover = Yii::app()->bootstrap->popoverSelector;
40 $tooltip = Yii::app()->bootstrap->tooltipSelector;
41
42 $afterAjaxUpdate = "js:function() {
43 jQuery('.popover').remove();
44 jQuery('{$popover}').popover();
45 jQuery('.tooltip').remove();
46 jQuery('{$tooltip}').tooltip();
47 }";
48
49 if (!isset($this->afterAjaxUpdate))
50 $this->afterAjaxUpdate = $afterAjaxUpdate;
51 }
52
53
54 }
55