@@ -26,13 +26,13 @@ |
||
26 | 26 | if (preg_match('/_{0,1}(size|length)_{0,1}/', $name)) |
27 | 27 | echo $formatter->asSize($value); |
28 | 28 | else if (strpos($name, 'speed') !== false) |
29 | - echo $formatter->asSize($value) . '/s'; |
|
29 | + echo $formatter->asSize($value).'/s'; |
|
30 | 30 | else if (strpos($name, 'time') !== false && is_numeric($value) && $value >= 0) |
31 | - echo number_format($value, 2) . 's'; |
|
31 | + echo number_format($value, 2).'s'; |
|
32 | 32 | else if ($name == 'http_code') { |
33 | 33 | $type = substr($value, 0, 1); |
34 | - echo Html::tag('span', $value . (isset(Response::$httpStatuses[$value]) ? (' (' . Response::$httpStatuses[$value] . ')') : ''), |
|
35 | - ['style' => 'color: '. ($type == 2 ? 'green' : ($type == 4 || $type == 5 ? 'red' : 'orange'))]); |
|
34 | + echo Html::tag('span', $value.(isset(Response::$httpStatuses[$value]) ? (' ('.Response::$httpStatuses[$value].')') : ''), |
|
35 | + ['style' => 'color: '.($type == 2 ? 'green' : ($type == 4 || $type == 5 ? 'red' : 'orange'))]); |
|
36 | 36 | } |
37 | 37 | else |
38 | 38 | echo htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) |
@@ -23,23 +23,24 @@ |
||
23 | 23 | <td> |
24 | 24 | <?php |
25 | 25 | |
26 | - if (preg_match('/_{0,1}(size|length)_{0,1}/', $name)) |
|
27 | - echo $formatter->asSize($value); |
|
28 | - else if (strpos($name, 'speed') !== false) |
|
29 | - echo $formatter->asSize($value) . '/s'; |
|
30 | - else if (strpos($name, 'time') !== false && is_numeric($value) && $value >= 0) |
|
31 | - echo number_format($value, 2) . 's'; |
|
32 | - else if ($name == 'http_code') { |
|
26 | + if (preg_match('/_{0,1}(size|length)_{0,1}/', $name)) { |
|
27 | + echo $formatter->asSize($value); |
|
28 | + } else if (strpos($name, 'speed') !== false) { |
|
29 | + echo $formatter->asSize($value) . '/s'; |
|
30 | + } else if (strpos($name, 'time') !== false && is_numeric($value) && $value >= 0) { |
|
31 | + echo number_format($value, 2) . 's'; |
|
32 | + } else if ($name == 'http_code') { |
|
33 | 33 | $type = substr($value, 0, 1); |
34 | 34 | echo Html::tag('span', $value . (isset(Response::$httpStatuses[$value]) ? (' (' . Response::$httpStatuses[$value] . ')') : ''), |
35 | 35 | ['style' => 'color: '. ($type == 2 ? 'green' : ($type == 4 || $type == 5 ? 'red' : 'orange'))]); |
36 | - } |
|
37 | - else |
|
38 | - echo htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) |
|
36 | + } else { |
|
37 | + echo htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) |
|
39 | 38 | ?> |
40 | 39 | </td> |
41 | 40 | </tr> |
42 | - <?php endforeach; ?> |
|
41 | + <?php endforeach; |
|
42 | + } |
|
43 | + ?> |
|
43 | 44 | </tbody> |
44 | 45 | </table> |
45 | 46 | </div> |
@@ -19,7 +19,7 @@ |
||
19 | 19 | 'class' => 'yii\grid\ActionColumn', |
20 | 20 | 'template' => '{view}', |
21 | 21 | 'buttons' => [ |
22 | - 'view' => function ($url, $model) { |
|
22 | + 'view' => function($url, $model) { |
|
23 | 23 | return Html::a( |
24 | 24 | Html::tag('span', '', ['class' => 'glyphicon glyphicon-eye-open']), ['error/view', 'id' => $model->id] |
25 | 25 | ); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | 'type', |
15 | 15 | [ |
16 | 16 | 'header' => Yii::t('audit', 'Data'), |
17 | - 'value' => function ($data) { |
|
17 | + 'value' => function($data) { |
|
18 | 18 | return \yii\helpers\VarDumper::dumpAsString($data['data']); |
19 | 19 | } |
20 | 20 | ] |
@@ -37,7 +37,7 @@ |
||
37 | 37 | ], |
38 | 38 | [ |
39 | 39 | 'header' => Yii::t('audit', 'Data'), |
40 | - 'value' => function ($data) { |
|
40 | + 'value' => function($data) { |
|
41 | 41 | $out = '<a class="data-toggle glyphicon glyphicon-plus" href="javascript:void(0);"></a>'; |
42 | 42 | $out .= '<pre style="display:none;">'; |
43 | 43 | $out .= \yii\helpers\VarDumper::dumpAsString($data['data']); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | 'class' => 'yii\grid\ActionColumn', |
20 | 20 | 'template' => '{view}', |
21 | 21 | 'buttons' => [ |
22 | - 'view' => function ($url, $model) { |
|
22 | + 'view' => function($url, $model) { |
|
23 | 23 | return Html::a( |
24 | 24 | Html::tag('span', '', ['class' => 'glyphicon glyphicon-eye-open']), ['mail/view', 'id' => $model->id] |
25 | 25 | ); |
@@ -24,11 +24,12 @@ |
||
24 | 24 | |
25 | 25 | if (isset($request['result'])) { |
26 | 26 | $xml = Helper::formatAsXML($request['result']); |
27 | - if ($xml) |
|
28 | - $tabs[] = [ |
|
27 | + if ($xml) { |
|
28 | + $tabs[] = [ |
|
29 | 29 | 'label' => \Yii::t('audit', 'Result - XML'), |
30 | 30 | 'content' => Html::tag('div', $xml, $preformatted) |
31 | 31 | ]; |
32 | + } |
|
32 | 33 | |
33 | 34 | $tabs[] = [ |
34 | 35 | 'label' => \Yii::t('audit', 'Result'), |
@@ -38,7 +38,7 @@ |
||
38 | 38 | unset($request['result']); |
39 | 39 | } |
40 | 40 | |
41 | -$tabs[] = [ 'label' => \Yii::t('audit', 'Info'), 'content' => $this->render('info_table', ['request' => $request]), 'active' => true ]; |
|
41 | +$tabs[] = ['label' => \Yii::t('audit', 'Info'), 'content' => $this->render('info_table', ['request' => $request]), 'active' => true]; |
|
42 | 42 | |
43 | 43 | echo Html::tag('h2', \Yii::t('audit', 'Request #{id}', ['id' => $index])), |
44 | 44 | WebHelper::bootstrap('Tabs', 'widget', ['items' => array_reverse($tabs)]); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | if (isset($request['error']) && isset($request['error'][1])) { |
12 | 12 | $error = \bedezign\yii2\audit\models\AuditError::findOne($request['error'][1]); |
13 | - $request['error'] = Html::a('[' . $request['error'][0] . '] ' . $error->message, ['error/view', 'id' => $error->id]); |
|
13 | + $request['error'] = Html::a('['.$request['error'][0].'] '.$error->message, ['error/view', 'id' => $error->id]); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | ?> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (is_array($value) || is_object($value)) |
32 | 32 | $value = \yii\helpers\ArrayHelper::toArray($value); |
33 | 33 | elseif ($name == 'duration') |
34 | - $value = number_format($value, 2) . 's'; |
|
34 | + $value = number_format($value, 2).'s'; |
|
35 | 35 | echo $name == 'error' ? $value : $formatter->asText(is_scalar($value) ? $value : VarDumper::dumpAsString($value)); |
36 | 36 | ?> |
37 | 37 | </td> |
@@ -28,10 +28,11 @@ |
||
28 | 28 | <th><?= Html::encode(\yii\helpers\Inflector::humanize($name)) ?></th> |
29 | 29 | <td> |
30 | 30 | <?php |
31 | - if (is_array($value) || is_object($value)) |
|
32 | - $value = \yii\helpers\ArrayHelper::toArray($value); |
|
33 | - elseif ($name == 'duration') |
|
34 | - $value = number_format($value, 2) . 's'; |
|
31 | + if (is_array($value) || is_object($value)) { |
|
32 | + $value = \yii\helpers\ArrayHelper::toArray($value); |
|
33 | + } elseif ($name == 'duration') { |
|
34 | + $value = number_format($value, 2) . 's'; |
|
35 | + } |
|
35 | 36 | echo $name == 'error' ? $value : $formatter->asText(is_scalar($value) ? $value : VarDumper::dumpAsString($value)); |
36 | 37 | ?> |
37 | 38 | </td> |
@@ -31,7 +31,7 @@ |
||
31 | 31 | [ |
32 | 32 | 'attribute' => 'entry_id', |
33 | 33 | 'class' => 'yii\grid\DataColumn', |
34 | - 'value' => function ($data) { |
|
34 | + 'value' => function($data) { |
|
35 | 35 | return $data->entry_id ? Html::a($data->entry_id, ['entry/view', 'id' => $data->entry_id]) : ''; |
36 | 36 | }, |
37 | 37 | 'format' => 'raw', |
@@ -9,7 +9,7 @@ |
||
9 | 9 | $this->title = Yii::t('audit', 'Javascript #{id}', ['id' => $model->id]); |
10 | 10 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']]; |
11 | 11 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Javascripts'), 'url' => ['index']]; |
12 | -$this->params['breadcrumbs'][] = '#' . $model->id; |
|
12 | +$this->params['breadcrumbs'][] = '#'.$model->id; |
|
13 | 13 | |
14 | 14 | echo Html::tag('h1', $this->title); |
15 | 15 |