Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
Yii Bootstrap 3
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Common
Yii Bootstrap 3
Commits
dad11791
Commit
dad11791
authored
Mar 08, 2012
by
niskac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added option to disable js, refactored code and updated the demo
parent
9db95b04
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
132 additions
and
32 deletions
+132
-32
Bootstrap.php
components/Bootstrap.php
+7
-0
main.php
demo/protected/views/layouts/main.php
+1
-1
index.php
demo/protected/views/site/index.php
+12
-14
BootActiveForm.php
widgets/BootActiveForm.php
+2
-1
BootBaseMenu.php
widgets/BootBaseMenu.php
+0
-3
BootBreadcrumbs.php
widgets/BootBreadcrumbs.php
+3
-3
BootButton.php
widgets/BootButton.php
+51
-0
BootButtonColumn.php
widgets/BootButtonColumn.php
+11
-2
BootButtonGroup.php
widgets/BootButtonGroup.php
+31
-0
BootDetailView.php
widgets/BootDetailView.php
+1
-1
BootDropdown.php
widgets/BootDropdown.php
+4
-1
BootMenu.php
widgets/BootMenu.php
+4
-1
BootModal.php
widgets/BootModal.php
+1
-1
BootNavbar.php
widgets/BootNavbar.php
+1
-1
BootProgress.php
widgets/BootProgress.php
+1
-1
BootTabbable.php
widgets/BootTabbable.php
+1
-1
BootThumbnails.php
widgets/BootThumbnails.php
+1
-1
No files found.
components/Bootstrap.php
View file @
dad11791
...
@@ -38,6 +38,10 @@ class Bootstrap extends CApplicationComponent
...
@@ -38,6 +38,10 @@ class Bootstrap extends CApplicationComponent
*/
*/
public
$responsiveCss
=
false
;
public
$responsiveCss
=
false
;
/**
/**
* @var boolean whether to register jQuery and the Bootstrap JavaScript.
*/
public
$enableJS
=
true
;
/**
* @var array the plugin options (name=>options).
* @var array the plugin options (name=>options).
* @since 0.9.8
* @since 0.9.8
*/
*/
...
@@ -60,9 +64,12 @@ class Bootstrap extends CApplicationComponent
...
@@ -60,9 +64,12 @@ class Bootstrap extends CApplicationComponent
if
(
$this
->
responsiveCss
)
if
(
$this
->
responsiveCss
)
$this
->
registerResponsiveCss
();
$this
->
registerResponsiveCss
();
if
(
$this
->
enableJS
)
{
Yii
::
app
()
->
clientScript
->
registerCoreScript
(
'jquery'
);
Yii
::
app
()
->
clientScript
->
registerCoreScript
(
'jquery'
);
$this
->
registerCorePlugins
();
$this
->
registerCorePlugins
();
}
}
}
/**
/**
* Returns whether a plugin is registered.
* Returns whether a plugin is registered.
...
...
demo/protected/views/layouts/main.php
View file @
dad11791
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
));
?>
));
?>
<?php
if
(
!
empty
(
$this
->
breadcrumbs
))
:?>
<?php
if
(
!
empty
(
$this
->
breadcrumbs
))
:?>
<?
php
$this
->
widget
(
'bootstrap.widgets.Boot
Crumb
'
,
array
(
<?
php
$this
->
widget
(
'bootstrap.widgets.Boot
Breadcrumbs
'
,
array
(
'links'
=>
$this
->
breadcrumbs
,
'links'
=>
$this
->
breadcrumbs
,
));
?>
));
?>
<?php
endif
?>
<?php
endif
?>
...
...
demo/protected/views/site/index.php
View file @
dad11791
...
@@ -42,11 +42,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -42,11 +42,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</section>
</section>
<section
id=
"boot
Crumb
"
>
<section
id=
"boot
Breadcrumbs
"
>
<h2>
Breadcrumbs
</h2>
<h2>
Breadcrumbs
</h2>
<?php
$this
->
widget
(
'bootstrap.widgets.Boot
Crumb
'
,
array
(
<?php
$this
->
widget
(
'bootstrap.widgets.Boot
Breadcrumbs
'
,
array
(
'links'
=>
array
(
'Library'
=>
'#'
,
'Data'
),
'links'
=>
array
(
'Library'
=>
'#'
,
'Data'
),
));
?>
));
?>
...
@@ -54,7 +54,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -54,7 +54,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php
echo
$parser
->
safeTransform
(
"~~~
<?php
echo
$parser
->
safeTransform
(
"~~~
[php]
[php]
<?php
\$
this->widget('bootstrap.widgets.Boot
Crumb
', array(
<?php
\$
this->widget('bootstrap.widgets.Boot
Breadcrumbs
', array(
'links'=>array('Library'=>'#', 'Data'),
'links'=>array('Library'=>'#', 'Data'),
)); ?>
)); ?>
~~~"
);
?>
~~~"
);
?>
...
@@ -81,7 +81,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -81,7 +81,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
array
(
'label'
=>
'Link'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Link'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Link'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Link'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Dropdown'
,
'url'
=>
'#'
,
'items'
=>
array
(
array
(
'label'
=>
'Dropdown'
,
'url'
=>
'#'
,
'items'
=>
array
(
array
(
'label'
=>
'DROPDOWN HEADER'
,
'header'
=>
true
),
array
(
'label'
=>
'DROPDOWN HEADER'
),
array
(
'label'
=>
'Action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Another action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Another action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Something else here'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Something else here'
,
'url'
=>
'#'
),
...
@@ -97,6 +97,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -97,6 +97,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
'items'
=>
array
(
'items'
=>
array
(
array
(
'label'
=>
'Link'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Link'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Dropdown'
,
'url'
=>
'#'
,
'items'
=>
array
(
array
(
'label'
=>
'Dropdown'
,
'url'
=>
'#'
,
'items'
=>
array
(
array
(
'label'
=>
'DROPDOWN HEADER'
),
array
(
'label'
=>
'Action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Another action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Another action'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Something else here'
,
'url'
=>
'#'
),
array
(
'label'
=>
'Something else here'
,
'url'
=>
'#'
),
...
@@ -124,7 +125,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -124,7 +125,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
array('label'=>'Home', 'url'=>'#', 'active'=>true),
array('label'=>'Home', 'url'=>'#', 'active'=>true),
array('label'=>'Link', 'url'=>'#'),
array('label'=>'Link', 'url'=>'#'),
array('label'=>'Dropdown', 'url'=>'#', 'items'=>array(
array('label'=>'Dropdown', 'url'=>'#', 'items'=>array(
array('label'=>'DROPDOWN HEADER'
, 'itemOptions'=>array('class'=>'nav-header')
),
array('label'=>'DROPDOWN HEADER'),
array('label'=>'Action', 'url'=>'#'),
array('label'=>'Action', 'url'=>'#'),
array('label'=>'Another action', 'url'=>'#'),
array('label'=>'Another action', 'url'=>'#'),
array('label'=>'Something else here', 'url'=>'#'),
array('label'=>'Something else here', 'url'=>'#'),
...
@@ -140,6 +141,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -140,6 +141,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
'items'=>array(
'items'=>array(
array('label'=>'Link', 'url'=>'#'),
array('label'=>'Link', 'url'=>'#'),
array('label'=>'Dropdown', 'url'=>'#', 'items'=>array(
array('label'=>'Dropdown', 'url'=>'#', 'items'=>array(
array('label'=>'DROPDOWN HEADER'),
array('label'=>'Action', 'url'=>'#'),
array('label'=>'Action', 'url'=>'#'),
array('label'=>'Another action', 'url'=>'#'),
array('label'=>'Another action', 'url'=>'#'),
array('label'=>'Something else here', 'url'=>'#'),
array('label'=>'Something else here', 'url'=>'#'),
...
@@ -470,11 +472,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -470,11 +472,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</section>
</section>
<section
id=
"bootThumbs"
>
<section
id=
"bootThumb
nail
s"
>
<h2>
Thumbnails
</h2>
<h2>
Thumbnails
</h2>
<?php
$this
->
widget
(
'bootstrap.widgets.BootThumbs'
,
array
(
<?php
$this
->
widget
(
'bootstrap.widgets.BootThumb
nail
s'
,
array
(
'dataProvider'
=>
$listDataProvider
,
'dataProvider'
=>
$listDataProvider
,
'template'
=>
"
{
items}\n{pager
}
"
,
'template'
=>
"
{
items}\n{pager
}
"
,
'itemView'
=>
'_thumb'
,
'itemView'
=>
'_thumb'
,
...
@@ -489,7 +491,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -489,7 +491,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php
echo
$parser
->
safeTransform
(
"~~~
<?php
echo
$parser
->
safeTransform
(
"~~~
[php]
[php]
<?php
\$
this->widget('bootstrap.widgets.BootThumbs', array(
<?php
\$
this->widget('bootstrap.widgets.BootThumb
nail
s', array(
'dataProvider'=>
\$
listDataProvider,
'dataProvider'=>
\$
listDataProvider,
'template'=>
\"
{
items}\\n{pager
}
\"
,
'template'=>
\"
{
items}\\n{pager
}
\"
,
'itemView'=>'_thumb',
'itemView'=>'_thumb',
...
@@ -701,10 +703,6 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
...
@@ -701,10 +703,6 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php
$this
->
endWidget
();
?>
<?php
$this
->
endWidget
();
?>
<div
class=
"alert alert-block alert-warning"
>
</div>
<h3>
Horizontal
</h3>
<h3>
Horizontal
</h3>
<?php
/** @var BootActiveForm $form */
<?php
/** @var BootActiveForm $form */
...
@@ -1367,13 +1365,13 @@ $('#buttonStateful').click(function() {
...
@@ -1367,13 +1365,13 @@ $('#buttonStateful').click(function() {
'scrollspy'
=>
array
(
'spy'
=>
'.subnav'
,
'offset'
=>
50
),
'scrollspy'
=>
array
(
'spy'
=>
'.subnav'
,
'offset'
=>
50
),
'items'
=>
array
(
'items'
=>
array
(
array
(
'label'
=>
'Alert'
,
'url'
=>
'#bootAlert'
),
array
(
'label'
=>
'Alert'
,
'url'
=>
'#bootAlert'
),
array
(
'label'
=>
'Breadcrumb'
,
'url'
=>
'#boot
Crumb
'
),
array
(
'label'
=>
'Breadcrumb'
,
'url'
=>
'#boot
Breadcrumbs
'
),
array
(
'label'
=>
'Navbar'
,
'url'
=>
'#bootNavbar'
),
array
(
'label'
=>
'Navbar'
,
'url'
=>
'#bootNavbar'
),
array
(
'label'
=>
'Menu'
,
'url'
=>
'#bootMenu'
),
array
(
'label'
=>
'Menu'
,
'url'
=>
'#bootMenu'
),
array
(
'label'
=>
'Tabbable'
,
'url'
=>
'#bootTabbable'
),
array
(
'label'
=>
'Tabbable'
,
'url'
=>
'#bootTabbable'
),
array
(
'label'
=>
'Detail view'
,
'url'
=>
'#bootDetailView'
),
array
(
'label'
=>
'Detail view'
,
'url'
=>
'#bootDetailView'
),
array
(
'label'
=>
'Grid view'
,
'url'
=>
'#bootGridView'
),
array
(
'label'
=>
'Grid view'
,
'url'
=>
'#bootGridView'
),
array
(
'label'
=>
'Thumbnail'
,
'url'
=>
'#bootThumbs'
),
array
(
'label'
=>
'Thumbnail'
,
'url'
=>
'#bootThumb
nail
s'
),
array
(
'label'
=>
'Tooltip'
,
'url'
=>
'#bootTooltip'
),
array
(
'label'
=>
'Tooltip'
,
'url'
=>
'#bootTooltip'
),
array
(
'label'
=>
'Popover'
,
'url'
=>
'#bootPopover'
),
array
(
'label'
=>
'Popover'
,
'url'
=>
'#bootPopover'
),
array
(
'label'
=>
'Modal'
,
'url'
=>
'#bootModal'
),
array
(
'label'
=>
'Modal'
,
'url'
=>
'#bootModal'
),
...
...
widgets/BootActiveForm.php
View file @
dad11791
...
@@ -14,12 +14,13 @@ Yii::import('bootstrap.widgets.input.BootInput');
...
@@ -14,12 +14,13 @@ Yii::import('bootstrap.widgets.input.BootInput');
*/
*/
class
BootActiveForm
extends
CActiveForm
class
BootActiveForm
extends
CActiveForm
{
{
//
The different f
orm types.
//
F
orm types.
const
TYPE_VERTICAL
=
'vertical'
;
const
TYPE_VERTICAL
=
'vertical'
;
const
TYPE_INLINE
=
'inline'
;
const
TYPE_INLINE
=
'inline'
;
const
TYPE_HORIZONTAL
=
'horizontal'
;
const
TYPE_HORIZONTAL
=
'horizontal'
;
const
TYPE_SEARCH
=
'search'
;
const
TYPE_SEARCH
=
'search'
;
// Input classes.
const
INPUT_HORIZONTAL
=
'bootstrap.widgets.input.BootInputHorizontal'
;
const
INPUT_HORIZONTAL
=
'bootstrap.widgets.input.BootInputHorizontal'
;
const
INPUT_INLINE
=
'bootstrap.widgets.input.BootInputInline'
;
const
INPUT_INLINE
=
'bootstrap.widgets.input.BootInputInline'
;
const
INPUT_SEARCH
=
'bootstrap.widgets.input.BootInputSearch'
;
const
INPUT_SEARCH
=
'bootstrap.widgets.input.BootInputSearch'
;
...
...
widgets/BootBaseMenu.php
View file @
dad11791
...
@@ -55,9 +55,6 @@ abstract class BootBaseMenu extends BootWidget
...
@@ -55,9 +55,6 @@ abstract class BootBaseMenu extends BootWidget
$item
[
'label'
]
=
'<i class="'
.
$item
[
'icon'
]
.
'"></i> '
.
$item
[
'label'
];
$item
[
'label'
]
=
'<i class="'
.
$item
[
'icon'
]
.
'"></i> '
.
$item
[
'label'
];
}
}
if
(
!
isset
(
$item
[
'header'
])
&&
!
isset
(
$item
[
'url'
]))
$item
[
'url'
]
=
'#'
;
if
(
isset
(
$item
[
'url'
]))
if
(
isset
(
$item
[
'url'
]))
return
CHtml
::
link
(
$item
[
'label'
],
$item
[
'url'
],
$item
[
'linkOptions'
]);
return
CHtml
::
link
(
$item
[
'label'
],
$item
[
'url'
],
$item
[
'linkOptions'
]);
else
else
...
...
widgets/Boot
Crumb
.php
→
widgets/Boot
Breadcrumbs
.php
View file @
dad11791
...
@@ -12,14 +12,14 @@ Yii::import('zii.widgets.CBreadcrumbs');
...
@@ -12,14 +12,14 @@ Yii::import('zii.widgets.CBreadcrumbs');
/**
/**
* Bootstrap breadcrumb widget.
* Bootstrap breadcrumb widget.
*/
*/
class
Boot
Crumb
extends
CBreadcrumbs
class
Boot
Breadcrumbs
extends
CBreadcrumbs
{
{
/**
/**
* @var array the HTML attributes for the breadcrumbs container tag.
* @var array the HTML attributes for the breadcrumbs container tag.
*/
*/
public
$htmlOptions
=
array
(
'class'
=>
'breadcrumb'
);
public
$htmlOptions
=
array
(
'class'
=>
'breadcrumb'
);
/**
/**
* @var string the separator between links in the breadcrumbs
. Defaults to ' / '
.
* @var string the separator between links in the breadcrumbs
(defaults to ' / ')
.
*/
*/
public
$separator
=
'/'
;
public
$separator
=
'/'
;
...
...
widgets/BootButton.php
View file @
dad11791
...
@@ -10,13 +10,18 @@
...
@@ -10,13 +10,18 @@
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
/**
* Bootstrap button widget.
*/
class
BootButton
extends
BootWidget
class
BootButton
extends
BootWidget
{
{
// Button methods.
const
METHOD_LINK
=
'link'
;
const
METHOD_LINK
=
'link'
;
const
METHOD_BUTTON
=
'button'
;
const
METHOD_BUTTON
=
'button'
;
const
METHOD_AJAXLINK
=
'ajaxLink'
;
const
METHOD_AJAXLINK
=
'ajaxLink'
;
const
METHOD_AJAXBUTTON
=
'ajaxButton'
;
const
METHOD_AJAXBUTTON
=
'ajaxButton'
;
// Button types.
const
TYPE_NORMAL
=
''
;
const
TYPE_NORMAL
=
''
;
const
TYPE_PRIMARY
=
'primary'
;
const
TYPE_PRIMARY
=
'primary'
;
const
TYPE_INFO
=
'info'
;
const
TYPE_INFO
=
'info'
;
...
@@ -25,22 +30,65 @@ class BootButton extends BootWidget
...
@@ -25,22 +30,65 @@ class BootButton extends BootWidget
const
TYPE_DANGER
=
'danger'
;
const
TYPE_DANGER
=
'danger'
;
const
TYPE_INVERSE
=
'inverse'
;
const
TYPE_INVERSE
=
'inverse'
;
// Button sizes.
const
SIZE_SMALL
=
'small'
;
const
SIZE_SMALL
=
'small'
;
const
SIZE_NORMAL
=
''
;
const
SIZE_NORMAL
=
''
;
const
SIZE_LARGE
=
'large'
;
const
SIZE_LARGE
=
'large'
;
/**
* @var string the method to use for rendering the button.
* Valid values are 'link', 'button', 'ajaxLink' and 'ajaxButton'.
*/
public
$method
=
self
::
METHOD_LINK
;
public
$method
=
self
::
METHOD_LINK
;
/**
* @var string the button type.
* Valid values are '', 'primary', 'info', 'success', 'warning', 'danger' and 'inverse'.
*/
public
$type
=
self
::
TYPE_NORMAL
;
public
$type
=
self
::
TYPE_NORMAL
;
/**
* @var string the button size.
* Valid values are '', 'small' and 'large'.
*/
public
$size
=
self
::
SIZE_NORMAL
;
public
$size
=
self
::
SIZE_NORMAL
;
/**
* @var string the button icon, e.g. 'ok' or 'remove white'.
*/
public
$icon
;
public
$icon
;
/**
* @var string the button label.
*/
public
$label
;
public
$label
;
/**
* @var string the button URL.
*/
public
$url
;
public
$url
;
/**
* @var boolean indicates whether the button is active.
*/
public
$active
=
false
;
public
$active
=
false
;
/**
* @var array the dropdown button items.
*/
public
$items
;
public
$items
;
/**
* @var boolean indicates whether to enable toggle.
*/
public
$toggle
;
public
$toggle
;
/**
* @var string the loading text.
*/
public
$loadingText
;
public
$loadingText
;
/**
* @var string the complete text.
*/
public
$completeText
;
public
$completeText
;
/**
* @var boolean indicates whether to encode the label.
*/
public
$encodeLabel
=
true
;
public
$encodeLabel
=
true
;
/**
* @var array the button ajax options (used by 'ajaxLink' and 'ajaxButton').
*/
public
$ajaxOptions
=
array
();
public
$ajaxOptions
=
array
();
/**
/**
...
@@ -70,6 +118,9 @@ class BootButton extends BootWidget
...
@@ -70,6 +118,9 @@ class BootButton extends BootWidget
if
(
$this
->
hasDropdown
())
if
(
$this
->
hasDropdown
())
{
{
if
(
!
isset
(
$this
->
url
))
$this
->
url
=
'#'
;
$class
[]
=
'dropdown-toggle'
;
$class
[]
=
'dropdown-toggle'
;
$this
->
label
.=
' <span class="caret"></span>'
;
$this
->
label
.=
' <span class="caret"></span>'
;
$this
->
htmlOptions
[
'data-toggle'
]
=
'dropdown'
;
$this
->
htmlOptions
[
'data-toggle'
]
=
'dropdown'
;
...
...
widgets/BootButtonColumn.php
View file @
dad11791
...
@@ -5,19 +5,28 @@
...
@@ -5,19 +5,28 @@
* @copyright Copyright © Christoffer Niska 2011-
* @copyright Copyright © Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package bootstrap.widgets
* @package bootstrap.widgets
* @since 0.9.8
*/
*/
Yii
::
import
(
'zii.widgets.grid.CButtonColumn'
);
Yii
::
import
(
'zii.widgets.grid.CButtonColumn'
);
/**
/**
* Bootstrap button column widget.
* Bootstrap button column widget.
* Used to set zbuttons to use Glyphicons instead of the defaults.
* Used to set buttons to use Glyphicons instead of the defaults images.
* @since 0.9.8
*/
*/
class
BootButtonColumn
extends
CButtonColumn
class
BootButtonColumn
extends
CButtonColumn
{
{
/**
* @var string the view button icon (defaults to 'eye-open').
*/
public
$viewButtonIcon
=
'eye-open'
;
public
$viewButtonIcon
=
'eye-open'
;
/**
* @var string the update button icon (defaults to 'pencil').
*/
public
$updateButtonIcon
=
'pencil'
;
public
$updateButtonIcon
=
'pencil'
;
/**
* @var string the delete button icon (defaults to 'trash').
*/
public
$deleteButtonIcon
=
'trash'
;
public
$deleteButtonIcon
=
'trash'
;
/**
/**
...
...
widgets/BootButtonGroup.php
View file @
dad11791
...
@@ -11,18 +11,46 @@
...
@@ -11,18 +11,46 @@
Yii
::
import
(
'bootstrap.widgets.BootButton'
);
Yii
::
import
(
'bootstrap.widgets.BootButton'
);
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
/**
* Bootstrap button group widget.
*/
class
BootButtonGroup
extends
BootWidget
class
BootButtonGroup
extends
BootWidget
{
{
// Toggle options.
const
TOGGLE_CHECKBOX
=
'checkbox'
;
const
TOGGLE_CHECKBOX
=
'checkbox'
;
const
TOGGLE_RADIO
=
'radio'
;
const
TOGGLE_RADIO
=
'radio'
;
/**
* @var string the button method.
* @see BootButton::method
*/
public
$method
=
BootButton
::
METHOD_LINK
;
public
$method
=
BootButton
::
METHOD_LINK
;
/**
* @var string the button type.
* @see BootButton::type
*/
public
$type
=
BootButton
::
TYPE_NORMAL
;
public
$type
=
BootButton
::
TYPE_NORMAL
;
/**
* @var string the button size.
* @see BootButton::size
*/
public
$size
=
BootButton
::
SIZE_NORMAL
;
public
$size
=
BootButton
::
SIZE_NORMAL
;
/**
* @var boolean indicates whether to encode the button labels.
*/
public
$encodeLabel
=
true
;
public
$encodeLabel
=
true
;
/**
* @var array the button configuration.
*/
public
$buttons
=
array
();
public
$buttons
=
array
();
/**
* @var boolean indicates whether to enable button toggling.
*/
public
$toggle
;
public
$toggle
;
/**
* Initializes the widget.
*/
public
function
init
()
public
function
init
()
{
{
$cssClass
=
'btn-group'
;
$cssClass
=
'btn-group'
;
...
@@ -40,6 +68,9 @@ class BootButtonGroup extends BootWidget
...
@@ -40,6 +68,9 @@ class BootButtonGroup extends BootWidget
}
}
}
}
/**
* Runs the widget.
*/
public
function
run
()
public
function
run
()
{
{
echo
CHtml
::
openTag
(
'div'
,
$this
->
htmlOptions
);
echo
CHtml
::
openTag
(
'div'
,
$this
->
htmlOptions
);
...
...
widgets/BootDetailView.php
View file @
dad11791
...
@@ -18,7 +18,7 @@ class BootDetailView extends CDetailView
...
@@ -18,7 +18,7 @@ class BootDetailView extends CDetailView
/**
/**
* @var string the template used to render a single attribute. Defaults to a table row.
* @var string the template used to render a single attribute. Defaults to a table row.
*/
*/
public
$itemTemplate
=
"<tr class=
\"
{
class
}
\"
><th style=
\"
width: 160px
\"
>
{
label}</th><td>{value
}
</td></tr>
\n
"
;
public
$itemTemplate
=
"<tr class=
\"
{
class
}
\"
><th style=
\"
width: 160px
\"
>
{
label}</th><td>{value
}
</td></tr>
\n
"
;
/**
/**
* @var array the CSS class names for the items displaying attribute values.
* @var array the CSS class names for the items displaying attribute values.
*/
*/
...
...
widgets/BootDropdown.php
View file @
dad11791
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
Yii
::
import
(
'bootstrap.widgets.BootBaseMenu'
);
Yii
::
import
(
'bootstrap.widgets.BootBaseMenu'
);
/**
* Bootstrap dropdown menu widget.
*/
class
BootDropdown
extends
BootBaseMenu
class
BootDropdown
extends
BootBaseMenu
{
{
/**
/**
...
@@ -45,7 +48,7 @@ class BootDropdown extends BootBaseMenu
...
@@ -45,7 +48,7 @@ class BootDropdown extends BootBaseMenu
$item
[
'itemOptions'
]
=
array
();
$item
[
'itemOptions'
]
=
array
();
$class
=
array
();
$class
=
array
();
if
(
isset
(
$item
[
'header
'
]))
if
(
!
isset
(
$item
[
'url
'
]))
$class
[]
=
'nav-header'
;
$class
[]
=
'nav-header'
;
if
(
$item
[
'active'
])
if
(
$item
[
'active'
])
...
...
widgets/BootMenu.php
View file @
dad11791
...
@@ -16,7 +16,7 @@ Yii::import('bootstrap.widgets.BootBaseMenu');
...
@@ -16,7 +16,7 @@ Yii::import('bootstrap.widgets.BootBaseMenu');
*/
*/
class
BootMenu
extends
BootBaseMenu
class
BootMenu
extends
BootBaseMenu
{
{
//
The different m
enu types.
//
M
enu types.
const
TYPE_UNSTYLED
=
''
;
const
TYPE_UNSTYLED
=
''
;
const
TYPE_TABS
=
'tabs'
;
const
TYPE_TABS
=
'tabs'
;
const
TYPE_PILLS
=
'pills'
;
const
TYPE_PILLS
=
'pills'
;
...
@@ -151,6 +151,9 @@ class BootMenu extends BootBaseMenu
...
@@ -151,6 +151,9 @@ class BootMenu extends BootBaseMenu
$item
[
'label'
]
.=
' <span class="caret"></span>'
;
$item
[
'label'
]
.=
' <span class="caret"></span>'
;
}
}
if
(
!
isset
(
$item
[
'url'
]))
$item
[
'url'
]
=
'#'
;
return
parent
::
renderItem
(
$item
);
return
parent
::
renderItem
(
$item
);
}
}
...
...
widgets/BootModal.php
View file @
dad11791
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
* @copyright Copyright © Christoffer Niska 2011-
* @copyright Copyright © Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package bootstrap.widgets
* @package bootstrap.widgets
* @since 0.9.3
*/
*/
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
/**
/**
* Bootstrap modal widget.
* Bootstrap modal widget.
* @since 0.9.3
*/
*/
class
BootModal
extends
BootWidget
class
BootModal
extends
BootWidget
{
{
...
...
widgets/BootNavbar.php
View file @
dad11791
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
* @copyright Copyright © Christoffer Niska 2011-
* @copyright Copyright © Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package bootstrap.widgets
* @package bootstrap.widgets
* @since 0.9.7
*/
*/
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
Yii
::
import
(
'bootstrap.widgets.BootWidget'
);
/**
/**
* Bootstrap navigation bar widget.
* Bootstrap navigation bar widget.
* @since 0.9.7
*/
*/
class
BootNavbar
extends
BootWidget
class
BootNavbar
extends
BootWidget
{
{
...
...
widgets/BootProgress.php
View file @
dad11791
...
@@ -15,7 +15,7 @@ Yii::import('bootstrap.widgets.BootWidget');
...
@@ -15,7 +15,7 @@ Yii::import('bootstrap.widgets.BootWidget');
*/
*/
class
BootProgress
extends
BootWidget
class
BootProgress
extends
BootWidget
{
{
//
The different p
rogress bar types.
//
P
rogress bar types.
const
TYPE_DEFAULT
=
''
;
const
TYPE_DEFAULT
=
''
;
const
TYPE_INFO
=
'info'
;
const
TYPE_INFO
=
'info'
;
const
TYPE_SUCCESS
=
'success'
;
const
TYPE_SUCCESS
=
'success'
;
...
...
widgets/BootTabbable.php
View file @
dad11791
...
@@ -17,7 +17,7 @@ Yii::import('bootstrap.widgets.BootWidget');
...
@@ -17,7 +17,7 @@ Yii::import('bootstrap.widgets.BootWidget');
*/
*/
class
BootTabbable
extends
BootWidget
class
BootTabbable
extends
BootWidget
{
{
// T
he valid
placements.
// T
ab
placements.
const
PLACEMENT_ABOVE
=
'above'
;
const
PLACEMENT_ABOVE
=
'above'
;
const
PLACEMENT_BELOW
=
'below'
;
const
PLACEMENT_BELOW
=
'below'
;
const
PLACEMENT_LEFT
=
'left'
;
const
PLACEMENT_LEFT
=
'left'
;
...
...
widgets/BootThumbs.php
→
widgets/BootThumb
nail
s.php
View file @
dad11791
...
@@ -12,7 +12,7 @@ Yii::import('bootstrap.widgets.BootListView');
...
@@ -12,7 +12,7 @@ Yii::import('bootstrap.widgets.BootListView');
/**
/**
* Bootstrap thumbnails widget.
* Bootstrap thumbnails widget.
*/
*/
class
BootThumbs
extends
BootListView
class
BootThumb
nail
s
extends
BootListView
{
{
/**
/**
* Renders the data items for the view.
* Renders the data items for the view.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment