Skip to content

Commit

Permalink
Type,State widgets updated due to parent class API change
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Nov 11, 2015
1 parent 1124053 commit 8eb6cfb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/widgets/account/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class State extends Label
{
public $model = [];

public function run () {
public function init () {
$state = $this->model->state;
if ($state=='ok') $class = 'info';
elseif ($state=='blocked') $class = 'danger';
else $class = 'warning';

$this->color = $class;
$this->label = Yii::t('app', $this->model->state_label);
parent::run();
parent::init();
}
}
6 changes: 3 additions & 3 deletions src/widgets/account/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class Type extends Label
{
public $model = [];

public function run () {
public function init () {
$type = $this->model->type;
if ($type=='user') $class = 'info';
else $type = 'warning';
else $class = 'warning';

$this->color = $class;
$this->label = Yii::t('app', $this->model->type_label);
parent::run();
parent::init();
}
}
4 changes: 2 additions & 2 deletions src/widgets/db/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class State extends Label
{
public $model = [];

public function run () {
public function init () {
$state = $this->model->state;
if ($state=='ok') $class = 'info';
elseif ($state=='blocked') $class = 'danger';
else $class = 'warning';

$this->color = $class;
$this->label = Yii::t('app', $this->model->state_label);
parent::run();
parent::init();
}
}
15 changes: 10 additions & 5 deletions src/widgets/hdomain/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ class State extends Label
{
public $model = [];

public function run () {
public function init()
{
$state = $this->model->state;
if ($state=='ok') $class = 'info';
elseif ($state=='blocked') $class = 'danger';
else $class = 'warning';
if ($state == 'ok') {
$class = 'info';
} elseif ($state == 'blocked') {
$class = 'danger';
} else {
$class = 'warning';
}

$this->color = $class;
$this->label = Yii::t('app', $this->model->state_label);
parent::run();
parent::init();
}
}

0 comments on commit 8eb6cfb

Please sign in to comment.