Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
a53b3e57
Commit
a53b3e57
authored
Dec 20, 2013
by
tonydspaniard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update collapse to use bootstrap 3 classes fixes #1459
parent
65d72eb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
Collapse.php
extensions/yii/bootstrap/Collapse.php
+8
-6
No files found.
extensions/yii/bootstrap/Collapse.php
View file @
a53b3e57
...
@@ -66,7 +66,7 @@ class Collapse extends Widget
...
@@ -66,7 +66,7 @@ class Collapse extends Widget
public
function
init
()
public
function
init
()
{
{
parent
::
init
();
parent
::
init
();
Html
::
addCssClass
(
$this
->
options
,
'
accordion
'
);
Html
::
addCssClass
(
$this
->
options
,
'
panel-group
'
);
}
}
/**
/**
...
@@ -90,7 +90,7 @@ class Collapse extends Widget
...
@@ -90,7 +90,7 @@ class Collapse extends Widget
$index
=
0
;
$index
=
0
;
foreach
(
$this
->
items
as
$header
=>
$item
)
{
foreach
(
$this
->
items
as
$header
=>
$item
)
{
$options
=
ArrayHelper
::
getValue
(
$item
,
'options'
,
[]);
$options
=
ArrayHelper
::
getValue
(
$item
,
'options'
,
[]);
Html
::
addCssClass
(
$options
,
'
accordion-group
'
);
Html
::
addCssClass
(
$options
,
'
panel panel-default
'
);
$items
[]
=
Html
::
tag
(
'div'
,
$this
->
renderItem
(
$header
,
$item
,
++
$index
),
$options
);
$items
[]
=
Html
::
tag
(
'div'
,
$this
->
renderItem
(
$header
,
$item
,
++
$index
),
$options
);
}
}
...
@@ -111,21 +111,23 @@ class Collapse extends Widget
...
@@ -111,21 +111,23 @@ class Collapse extends Widget
$id
=
$this
->
options
[
'id'
]
.
'-collapse'
.
$index
;
$id
=
$this
->
options
[
'id'
]
.
'-collapse'
.
$index
;
$options
=
ArrayHelper
::
getValue
(
$item
,
'contentOptions'
,
[]);
$options
=
ArrayHelper
::
getValue
(
$item
,
'contentOptions'
,
[]);
$options
[
'id'
]
=
$id
;
$options
[
'id'
]
=
$id
;
Html
::
addCssClass
(
$options
,
'
accordion-body
collapse'
);
Html
::
addCssClass
(
$options
,
'
panel-collapse
collapse'
);
$header
=
Html
::
a
(
$header
,
'#'
.
$id
,
[
$header
Toggle
=
Html
::
a
(
$header
,
'#'
.
$id
,
[
'class'
=>
'accordion-toggle'
,
'class'
=>
'accordion-toggle'
,
'data-toggle'
=>
'collapse'
,
'data-toggle'
=>
'collapse'
,
'data-parent'
=>
'#'
.
$this
->
options
[
'id'
]
'data-parent'
=>
'#'
.
$this
->
options
[
'id'
]
])
.
"
\n
"
;
])
.
"
\n
"
;
$content
=
Html
::
tag
(
'div'
,
$item
[
'content'
],
[
'class'
=>
'accordion-inner'
])
.
"
\n
"
;
$header
=
Html
::
tag
(
'h4'
,
$headerToggle
,
[
'class'
=>
'panel-title'
]);
$content
=
Html
::
tag
(
'div'
,
$item
[
'content'
],
[
'class'
=>
'panel-body'
])
.
"
\n
"
;
}
else
{
}
else
{
throw
new
InvalidConfigException
(
'The "content" option is required.'
);
throw
new
InvalidConfigException
(
'The "content" option is required.'
);
}
}
$group
=
[];
$group
=
[];
$group
[]
=
Html
::
tag
(
'div'
,
$header
,
[
'class'
=>
'
accordion
-heading'
]);
$group
[]
=
Html
::
tag
(
'div'
,
$header
,
[
'class'
=>
'
panel
-heading'
]);
$group
[]
=
Html
::
tag
(
'div'
,
$content
,
$options
);
$group
[]
=
Html
::
tag
(
'div'
,
$content
,
$options
);
return
implode
(
"
\n
"
,
$group
);
return
implode
(
"
\n
"
,
$group
);
...
...
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