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
36c31ded
Commit
36c31ded
authored
May 23, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:yiisoft/yii2
parents
ebe31c5f
caf9948c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
5 deletions
+113
-5
YiiBase.php
framework/yii/YiiBase.php
+1
-0
HelpController.php
framework/yii/console/controllers/HelpController.php
+2
-2
Accordion.php
framework/yii/jui/Accordion.php
+107
-0
assets.php
framework/yii/jui/assets.php
+3
-3
No files found.
framework/yii/YiiBase.php
View file @
36c31ded
...
...
@@ -616,6 +616,7 @@ class YiiBase
YiiBase
::
$aliases
=
array
(
'@yii'
=>
array
(
'@yii/bootstrap'
=>
__DIR__
.
'/bootstrap'
,
'@yii/jui'
=>
__DIR__
.
'/jui'
,
'@yii'
=>
__DIR__
,
),
);
framework/yii/console/controllers/HelpController.php
View file @
36c31ded
...
...
@@ -13,7 +13,7 @@ use yii\base\InlineAction;
use
yii\console\Controller
;
use
yii\console\Exception
;
use
yii\console\Request
;
use
yii\helpers\
StringHelpe
r
;
use
yii\helpers\
Inflecto
r
;
/**
* This command provides help information about console commands.
...
...
@@ -96,7 +96,7 @@ class HelpController extends Controller
foreach
(
$class
->
getMethods
()
as
$method
)
{
$name
=
$method
->
getName
();
if
(
$method
->
isPublic
()
&&
!
$method
->
isStatic
()
&&
strpos
(
$name
,
'action'
)
===
0
&&
$name
!==
'actions'
)
{
$actions
[]
=
StringHelpe
r
::
camel2id
(
substr
(
$name
,
6
));
$actions
[]
=
Inflecto
r
::
camel2id
(
substr
(
$name
,
6
));
}
}
sort
(
$actions
);
...
...
framework/yii/jui/Accordion.php
0 → 100644
View file @
36c31ded
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\jui
;
use
yii\base\InvalidConfigException
;
use
yii\helpers\base\ArrayHelper
;
use
yii\helpers\Html
;
/**
* Accordion renders an accordion jQuery UI widget.
*
* For example:
*
* ```php
* echo Accordion::widget(array(
* 'items' => array(
* 'Section 1' => array(
* 'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...',
* 'contentOptions' => array(...),
* ),
* 'Section 2' => array(
* 'content' => 'Sed non urna. Phasellus eu ligula. Vestibulum sit amet purus...',
* 'headerOptions' => array(...),
* ),
* ),
* ));
* ```
*
* @see http://api.jqueryui.com/accordion/
* @author Alexander Kochetov <creocoder@gmail.com>
* @since 2.0
*/
class
Accordion
extends
Widget
{
/**
* @var array list of sections in the accordion widget. Each array element represents a single
* section with the following structure:
*
* ```php
* // item key is the actual section header
* 'Section' => array(
* // required, the content (HTML) of the section
* 'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...',
* // optional the HTML attributes of the content section
* 'contentOptions'=> array(...),
* // optional the HTML attributes of the header section
* 'headerOptions'=> array(...),
* )
* ```
*/
public
$items
=
array
();
/**
* Renders the widget.
*/
public
function
run
()
{
echo
Html
::
beginTag
(
'div'
,
$this
->
options
)
.
"
\n
"
;
echo
$this
->
renderItems
()
.
"
\n
"
;
echo
Html
::
endTag
(
'div'
)
.
"
\n
"
;
$this
->
registerWidget
(
'accordion'
);
}
/**
* Renders collapsible items as specified on [[items]].
* @return string the rendering result.
*/
public
function
renderItems
()
{
$items
=
array
();
foreach
(
$this
->
items
as
$header
=>
$item
)
{
$items
[]
=
$this
->
renderItem
(
$header
,
$item
);
}
return
implode
(
"
\n
"
,
$items
);
}
/**
* Renders a single collapsible item section.
* @param string $header a label of the item section [[items]].
* @param array $item a single item from [[items]].
* @return string the rendering result.
* @throws InvalidConfigException.
*/
public
function
renderItem
(
$header
,
$item
)
{
if
(
isset
(
$item
[
'content'
]))
{
$contentOptions
=
ArrayHelper
::
getValue
(
$item
,
'contentOptions'
,
array
());
$content
=
Html
::
tag
(
'div'
,
$item
[
'content'
])
.
"
\n
"
;
}
else
{
throw
new
InvalidConfigException
(
"The 'content' option is required."
);
}
$group
=
array
();
$headerOptions
=
ArrayHelper
::
getValue
(
$item
,
'headerOptions'
,
array
());
$group
[]
=
Html
::
tag
(
'h3'
,
$header
,
$headerOptions
);
$group
[]
=
Html
::
tag
(
'div'
,
$content
,
$contentOptions
);
return
implode
(
"
\n
"
,
$group
);
}
}
framework/yii/jui/assets.php
View file @
36c31ded
...
...
@@ -775,7 +775,7 @@ return array(
'css'
=>
array
(
'themes/base/jquery.ui.autocomplete.css'
,
),
'depends'
=>
array
(
'yii/jui/theme/base/core'
),
'depends'
=>
array
(
'yii/jui/theme/base/core'
,
'yii/jui/theme/base/menu'
),
),
'yii/jui/theme/base/button'
=>
array
(
'sourcePath'
=>
__DIR__
.
'/assets'
,
...
...
@@ -796,7 +796,7 @@ return array(
'css'
=>
array
(
'themes/base/jquery.ui.dialog.css'
,
),
'depends'
=>
array
(
'yii/jui/theme/base/core'
),
'depends'
=>
array
(
'yii/jui/theme/base/core'
,
'yii/jui/theme/base/button'
,
'yii/jui/theme/base/resizeable'
),
),
'yii/jui/theme/base/menu'
=>
array
(
'sourcePath'
=>
__DIR__
.
'/assets'
,
...
...
@@ -838,7 +838,7 @@ return array(
'css'
=>
array
(
'themes/base/jquery.ui.spinner.css'
,
),
'depends'
=>
array
(
'yii/jui/theme/base/core'
),
'depends'
=>
array
(
'yii/jui/theme/base/core'
,
'yii/jui/theme/base/button'
),
),
'yii/jui/theme/base/tabs'
=>
array
(
'sourcePath'
=>
__DIR__
.
'/assets'
,
...
...
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