@@ -38,11 +38,12 @@ discard block |
||
| 38 | 38 | ); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -if ($headers) |
|
| 41 | +if ($headers) { |
|
| 42 | 42 | $tabs[] = [ |
| 43 | 43 | 'label' => \Yii::t('audit', 'Headers'), |
| 44 | 44 | 'content' => Html::tag('div', $formatter->asNtext(implode('', $headers)), ['class' => 'well']) |
| 45 | 45 | ]; |
| 46 | +} |
|
| 46 | 47 | |
| 47 | 48 | if ($content) { |
| 48 | 49 | $tabs[] = [ |
@@ -56,11 +57,12 @@ discard block |
||
| 56 | 57 | ); |
| 57 | 58 | } |
| 58 | 59 | |
| 59 | -if ($log) |
|
| 60 | +if ($log) { |
|
| 60 | 61 | $tabs[] = [ |
| 61 | 62 | 'label' => \Yii::t('audit', 'Log'), |
| 62 | 63 | 'content' => Html::tag('div', $formatter->asText($log), $preformatted) |
| 63 | 64 | ]; |
| 65 | +} |
|
| 64 | 66 | |
| 65 | 67 | |
| 66 | 68 | echo Html::tag('h2', \Yii::t('audit', 'Request #{id}', ['id' => $index])), |
@@ -6,5 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | echo Html::tag('h1', $panel->name); |
| 8 | 8 | |
| 9 | -foreach ($dataProvider->allModels as $index => $request) |
|
| 9 | +foreach ($dataProvider->allModels as $index => $request) { |
|
| 10 | 10 | echo $this->render('detail', ['panel' => $panel, 'request' => $request, 'index' => $index + 1]); |
| 11 | +} |
|
@@ -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 | ); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | 'class' => 'yii\grid\ActionColumn', |
| 21 | 21 | 'template' => '{view}', |
| 22 | 22 | 'buttons' => [ |
| 23 | - 'view' => function ($url, $model) { |
|
| 23 | + 'view' => function($url, $model) { |
|
| 24 | 24 | return Html::a( |
| 25 | 25 | Html::tag('span', '', ['class' => 'glyphicon glyphicon-eye-open']), ['trail/view', 'id' => $model->id] |
| 26 | 26 | ); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'attribute' => 'user_id', |
| 41 | 41 | 'label' => Yii::t('audit', 'User ID'), |
| 42 | 42 | 'class' => 'yii\grid\DataColumn', |
| 43 | - 'value' => function ($data) { |
|
| 43 | + 'value' => function($data) { |
|
| 44 | 44 | return Audit::getInstance()->getUserIdentifier($data->user_id); |
| 45 | 45 | }, |
| 46 | 46 | 'options' => [ |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ], |
| 76 | 76 | [ |
| 77 | 77 | 'label' => Yii::t('audit', 'Diff'), |
| 78 | - 'value' => function ($data) { |
|
| 78 | + 'value' => function($data) { |
|
| 79 | 79 | return $data->getDiffHtml(); |
| 80 | 80 | }, |
| 81 | 81 | 'format' => 'raw', |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $this->title = Yii::t('audit', 'Entry #{id}', ['id' => $model->id]); |
| 21 | 21 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']]; |
| 22 | 22 | $this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Entries'), 'url' => ['index']]; |
| 23 | -$this->params['breadcrumbs'][] = '#' . $model->id; |
|
| 23 | +$this->params['breadcrumbs'][] = '#'.$model->id; |
|
| 24 | 24 | |
| 25 | 25 | ?> |
| 26 | 26 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | <div class="list-group"> |
| 84 | 84 | <?php |
| 85 | 85 | foreach ($panels as $id => $panel) { |
| 86 | - $label = '<i class="glyphicon glyphicon-chevron-right"></i>' . $panel->getLabel(); |
|
| 86 | + $label = '<i class="glyphicon glyphicon-chevron-right"></i>'.$panel->getLabel(); |
|
| 87 | 87 | echo Html::a($label, ['view', 'id' => $model->id, 'panel' => $id], [ |
| 88 | 88 | 'class' => $panel === $activePanel ? 'list-group-item active' : 'list-group-item', |
| 89 | 89 | ]); |