Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-widgets2-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hrzg
yii2-widgets2-module
Commits
b492448b
Commit
b492448b
authored
Jul 14, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated CSS classes
parent
b1998a8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
WidgetContainer.php
src/widgets/WidgetContainer.php
+10
-5
No files found.
src/widgets/WidgetContainer.php
View file @
b492448b
...
...
@@ -12,7 +12,6 @@ namespace hrzg\widget\widgets;
use
hrzg\widget\assets\WidgetAsset
;
use
hrzg\widget\models\crud\WidgetContent
;
use
rmrevin\yii\fontawesome\AssetBundle
;
use
rmrevin\yii\fontawesome\component\Icon
;
use
rmrevin\yii\fontawesome\FA
;
use
yii\base\Event
;
use
yii\base\Widget
;
...
...
@@ -22,6 +21,8 @@ use yii\helpers\Url;
class
WidgetContainer
extends
Widget
{
const
CSS_PREFIX
=
'hrzg-widget'
;
public
function
init
()
{
\Yii
::
$app
->
trigger
(
'registerMenuItems'
,
new
Event
([
'sender'
=>
$this
]));
...
...
@@ -32,7 +33,7 @@ class WidgetContainer extends Widget
public
function
run
()
{
Url
::
remember
(
''
,
$this
->
getRoute
());
Url
::
remember
(
''
,
$this
->
getRoute
());
return
$this
->
renderWidgets
();
}
...
...
@@ -89,13 +90,17 @@ class WidgetContainer extends Widget
return
$models
;
}
private
function
getRoute
(){
private
function
getRoute
()
{
return
\Yii
::
$app
->
controller
->
module
->
id
.
'/'
.
\Yii
::
$app
->
controller
->
id
.
'/'
.
\Yii
::
$app
->
controller
->
action
->
id
;
}
private
function
renderWidgets
()
{
$html
=
Html
::
beginTag
(
'div'
,
[
'class'
=>
'hrzg-widget-widget-container'
]);
$html
=
Html
::
beginTag
(
'div'
,
[
'class'
=>
self
::
CSS_PREFIX
.
'-'
.
$this
->
id
.
' '
.
self
::
CSS_PREFIX
.
'-widget-container'
]
);
if
(
\Yii
::
$app
->
user
->
can
(
'widgets'
))
{
$html
.=
$this
->
generateContainerControls
();
...
...
@@ -145,7 +150,7 @@ class WidgetContainer extends Widget
private
function
generateWidgetControls
(
$widget
)
{
$html
=
Html
::
beginTag
(
'div'
,
[
'class'
=>
'hrzg-widget-widget-controls btn-group'
,
'role'
=>
'group'
]);
$html
=
Html
::
beginTag
(
'div'
,
[
'class'
=>
'hrzg-widget-widget-controls btn-group'
,
'role'
=>
'group'
]);
$html
.=
Html
::
a
(
FA
::
icon
(
FA
::
_PENCIL
)
.
' #'
.
$widget
->
id
.
' '
.
$widget
->
template
->
name
.
' <span class="label label-default">'
.
$widget
->
rank
.
'</span>'
,
[
'/widgets/crud/widget/update'
,
'id'
=>
$widget
->
id
],
...
...
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