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
5b86e8fe
Commit
5b86e8fe
authored
Dec 19, 2012
by
Crisu83
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for inputs in TbButton and fix minor bug in TbAlert
parent
9468580a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
TbAlert.php
widgets/TbAlert.php
+1
-1
TbButton.php
widgets/TbButton.php
+10
-1
No files found.
widgets/TbAlert.php
View file @
5b86e8fe
...
@@ -116,7 +116,7 @@ class TbAlert extends CWidget
...
@@ -116,7 +116,7 @@ class TbAlert extends CWidget
if
(
$this
->
closeText
!==
false
&&
!
isset
(
$alert
[
'closeText'
]))
if
(
$this
->
closeText
!==
false
&&
!
isset
(
$alert
[
'closeText'
]))
$alert
[
'closeText'
]
=
$this
->
closeText
;
$alert
[
'closeText'
]
=
$this
->
closeText
;
if
(
$alert
[
'closeText'
]
!==
false
)
if
(
isset
(
$alert
[
'closeText'
])
&&
$alert
[
'closeText'
]
!==
false
)
echo
'<a class="close" data-dismiss="alert">'
.
$alert
[
'closeText'
]
.
'</a>'
;
echo
'<a class="close" data-dismiss="alert">'
.
$alert
[
'closeText'
]
.
'</a>'
;
echo
Yii
::
app
()
->
user
->
getFlash
(
$type
);
echo
Yii
::
app
()
->
user
->
getFlash
(
$type
);
...
...
widgets/TbButton.php
View file @
5b86e8fe
...
@@ -23,6 +23,8 @@ class TbButton extends CWidget
...
@@ -23,6 +23,8 @@ class TbButton extends CWidget
const
BUTTON_AJAXLINK
=
'ajaxLink'
;
const
BUTTON_AJAXLINK
=
'ajaxLink'
;
const
BUTTON_AJAXBUTTON
=
'ajaxButton'
;
const
BUTTON_AJAXBUTTON
=
'ajaxButton'
;
const
BUTTON_AJAXSUBMIT
=
'ajaxSubmit'
;
const
BUTTON_AJAXSUBMIT
=
'ajaxSubmit'
;
const
BUTTON_INPUTBUTTON
=
'inputButton'
;
const
BUTTON_INPUTSUBMIT
=
'inputSubmit'
;
// Button types.
// Button types.
const
TYPE_PRIMARY
=
'primary'
;
const
TYPE_PRIMARY
=
'primary'
;
...
@@ -232,12 +234,19 @@ class TbButton extends CWidget
...
@@ -232,12 +234,19 @@ class TbButton extends CWidget
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
case
self
::
BUTTON_AJAXSUBMIT
:
case
self
::
BUTTON_AJAXSUBMIT
:
$this
->
ajaxOptions
[
'type'
]
=
'POST'
;
$this
->
ajaxOptions
[
'type'
]
=
isset
(
$this
->
ajaxOptions
[
'type'
])
?
$this
->
ajaxOptions
[
'type'
]
:
'POST'
;
$this
->
ajaxOptions
[
'url'
]
=
$this
->
url
;
$this
->
ajaxOptions
[
'url'
]
=
$this
->
url
;
$this
->
htmlOptions
[
'type'
]
=
'submit'
;
$this
->
htmlOptions
[
'type'
]
=
'submit'
;
$this
->
htmlOptions
[
'ajax'
]
=
$this
->
ajaxOptions
;
$this
->
htmlOptions
[
'ajax'
]
=
$this
->
ajaxOptions
;
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
return
CHtml
::
htmlButton
(
$this
->
label
,
$this
->
htmlOptions
);
case
self
::
BUTTON_INPUTBUTTON
:
return
CHtml
::
button
(
$this
->
label
,
$this
->
htmlOptions
);
case
self
::
BUTTON_INPUTSUBMIT
:
$this
->
htmlOptions
[
'type'
]
=
'submit'
;
return
CHtml
::
button
(
$this
->
label
,
$this
->
htmlOptions
);
default
:
default
:
case
self
::
BUTTON_LINK
:
case
self
::
BUTTON_LINK
:
return
CHtml
::
link
(
$this
->
label
,
$this
->
url
,
$this
->
htmlOptions
);
return
CHtml
::
link
(
$this
->
label
,
$this
->
url
,
$this
->
htmlOptions
);
...
...
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