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
c852ba45
Commit
c852ba45
authored
Oct 17, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5617 from pana1990/patch-1
refactoring code
parents
8c50ee9e
8c8b7a77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
AssetPanel.php
extensions/debug/panels/AssetPanel.php
+8
-11
No files found.
extensions/debug/panels/AssetPanel.php
View file @
c852ba45
...
@@ -51,9 +51,6 @@ class AssetPanel extends Panel
...
@@ -51,9 +51,6 @@ class AssetPanel extends Panel
public
function
save
()
public
function
save
()
{
{
$bundles
=
Yii
::
$app
->
view
->
assetManager
->
bundles
;
$bundles
=
Yii
::
$app
->
view
->
assetManager
->
bundles
;
if
(
empty
(
$bundles
))
{
return
[];
}
$data
=
[];
$data
=
[];
foreach
(
$bundles
as
$name
=>
$bundle
)
{
foreach
(
$bundles
as
$name
=>
$bundle
)
{
if
(
$bundle
instanceof
AssetBundle
)
{
if
(
$bundle
instanceof
AssetBundle
)
{
...
@@ -65,9 +62,9 @@ class AssetPanel extends Panel
...
@@ -65,9 +62,9 @@ class AssetPanel extends Panel
/**
/**
* Additional formatting for view.
* Additional formatting for view.
*
*
* @param AssetBundle[] $bundles Array of bundles to formatting.
* @param AssetBundle[] $bundles Array of bundles to formatting.
*
*
* @return AssetManager
* @return AssetManager
*/
*/
protected
function
format
(
array
$bundles
)
protected
function
format
(
array
$bundles
)
...
@@ -76,7 +73,7 @@ class AssetPanel extends Panel
...
@@ -76,7 +73,7 @@ class AssetPanel extends Panel
$this
->
cssCount
+=
count
(
$bundle
->
css
);
$this
->
cssCount
+=
count
(
$bundle
->
css
);
$this
->
jsCount
+=
count
(
$bundle
->
js
);
$this
->
jsCount
+=
count
(
$bundle
->
js
);
array_walk
(
$bundle
->
css
,
function
(
&
$file
,
$key
,
$userdata
)
{
array_walk
(
$bundle
->
css
,
function
(
&
$file
,
$key
,
$userdata
)
{
$file
=
Html
::
a
(
$file
,
$userdata
->
baseUrl
.
'/'
.
$file
,
[
'target'
=>
'_blank'
]);
$file
=
Html
::
a
(
$file
,
$userdata
->
baseUrl
.
'/'
.
$file
,
[
'target'
=>
'_blank'
]);
},
$bundle
);
},
$bundle
);
...
@@ -88,18 +85,18 @@ class AssetPanel extends Panel
...
@@ -88,18 +85,18 @@ class AssetPanel extends Panel
array_walk
(
$bundle
->
depends
,
function
(
&
$depend
)
{
array_walk
(
$bundle
->
depends
,
function
(
&
$depend
)
{
$depend
=
Html
::
a
(
$depend
,
'#'
.
$depend
);
$depend
=
Html
::
a
(
$depend
,
'#'
.
$depend
);
});
});
$this
->
formatOptions
(
$bundle
->
publishOptions
);
$this
->
formatOptions
(
$bundle
->
publishOptions
);
$this
->
formatOptions
(
$bundle
->
jsOptions
);
$this
->
formatOptions
(
$bundle
->
jsOptions
);
$this
->
formatOptions
(
$bundle
->
cssOptions
);
$this
->
formatOptions
(
$bundle
->
cssOptions
);
}
}
return
$bundles
;
return
$bundles
;
}
}
/**
/**
* Format associative array of params to simple value.
* Format associative array of params to simple value.
*
*
* @param array $params
* @param array $params
*
*
* @return array
* @return array
...
@@ -109,11 +106,11 @@ class AssetPanel extends Panel
...
@@ -109,11 +106,11 @@ class AssetPanel extends Panel
if
(
!
is_array
(
$params
))
{
if
(
!
is_array
(
$params
))
{
return
$params
;
return
$params
;
}
}
foreach
(
$params
as
$param
=>
$value
)
{
foreach
(
$params
as
$param
=>
$value
)
{
$params
[
$param
]
=
Html
::
tag
(
'strong'
,
'\''
.
$param
.
'\' => '
)
.
(
string
)
$value
;
$params
[
$param
]
=
Html
::
tag
(
'strong'
,
'\''
.
$param
.
'\' => '
)
.
(
string
)
$value
;
}
}
return
$params
;
return
$params
;
}
}
}
}
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