SproutCMS

This is the code documentation for the SproutCMS project

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

  1. <?php
  2. use Sprout\Helpers\Inflector;
  3. use Sprout\Helpers\Enc;
  4. ?>
  5.  
  6. <?php if (empty($usage)): ?>
  7. <p>Unable to locate any live instances of this file.</p>
  8. <?php else: ?>
  9. <table class="main-list">
  10. <thead>
  11. <tr>
  12. <th>Table</th>
  13. <th>Record ID or name</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php
  18. foreach ($usage as $row) {
  19. echo '<tr>';
  20.  
  21. $ctlr_name = Inflector::singular($row[0]);
  22. printf('<td><a href="SITE/admin/edit/%s/%s">%s</a></td>', Enc::html($ctlr_name), Enc::html($row[1]), Enc::html($row[0]));
  23.  
  24. echo '<td>', Enc::html($row[2] ? $row[2] : 'ID # ' . $row[1]), '</td>';
  25. echo '</tr>';
  26. echo "\n";
  27. }
  28. ?>
  29. </tbody>
  30. </table>
  31. <?php endif; ?>
  32.