SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/admin/action_log_edit.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16. use Sprout\Helpers\ColModifierHexIP;
  17. use Sprout\Helpers\Csrf;
  18. use Sprout\Helpers\Enc;
  19. use Sprout\Helpers\Sprout;
  20.  
  21.  
  22. $info = json_decode($data['data']);
  23. ?>
  24.  
  25.  
  26. <div class="white-box">
  27. <div class="columns">
  28. <div class="column column-3">
  29. <b>Type:</b>
  30. <br>
  31. <?= Enc::html($data['type']); ?>
  32. </div>
  33. <div class="column column-3">
  34. <b>Date:</b>
  35. <br>
  36. <?= Enc::html(Sprout::formatMysqlDatetime($data['date_added'])); ?>
  37. </div>
  38. <div class="column column-3">
  39. <b>Table:</b>
  40. <br>
  41. <?= Enc::html($data['record_table']); ?>
  42. </div>
  43. <div class="column column-3">
  44. <b>Record ID:</b>
  45. <br>
  46. <?= Enc::html($data['record_id']); ?>
  47. </div>
  48. </div>
  49. <br>
  50. <div class="columns">
  51. <div class="column column-3">
  52. <b>Editor:</b>
  53. <br>
  54. <?= Enc::html($data['modified_editor']); ?>
  55. </div>
  56. <div class="column column-3">
  57. <b>IP Address:</b>
  58. <br>
  59. <?php
  60. $mod = new ColModifierHexIP();
  61. echo Enc::html($mod->modify($data['ip_address'], ''));
  62. ?>
  63. </div>
  64. <div class="column column-6">
  65. <?php
  66. if ($data['user_agent']) {
  67. echo "<p><b>User-agent:</b>\n";
  68. echo '<br>', Enc::html($data['user_agent']), "</p>\n";
  69. }
  70. ?>
  71. </div>
  72. </div>
  73. </div>
  74.  
  75.  
  76. <?php if (!empty($controller)): ?>
  77. <?php if ($data['type'] == 'Delete' and $data['restored_date'][0] == '0'): ?>
  78. <form action="admin/restore/<?php echo $id; ?>" method="post">
  79. <?php echo Csrf::token(); ?>
  80. <button type="submit" class="button">Restore record</button>
  81. </form>
  82.  
  83. <?php else: ?>
  84. <?php if ($data['type'] == 'Delete'): ?>
  85. <p>This record was restored by <?= Enc::html($data['restored_operator']); ?> on <?= date('D j/n/Y \a\t g:i a', strtotime($data['restored_date'])); ?></p>
  86. <?php endif; ?>
  87. <p>
  88. <a href="SITE/admin/edit/<?php echo Enc::html($controller); ?>/<?php echo $data['record_id']; ?>" class="button">View record</a>
  89. </p>
  90. <?php endif; ?>
  91. <?php endif; ?>
  92.  
  93.  
  94. <?php
  95. if (!empty($info)):
  96. ?>
  97. <h3>Data</h3>
  98. <table class="form-section">
  99. <?php foreach ($info as $key => $val): ?>
  100. <tr>
  101. <th><?= Enc::html($key); ?></th>
  102. <td><?= Enc::html($val); ?></td>
  103. </tr>
  104. <?php endforeach; ?>
  105. </table>
  106. <?php endif; ?>
  107.