index.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <style>
  2. a.smr {font-size:0.8em;}
  3. </style>
  4. <div class="page-header">
  5. <h2><?= $title ?></h2>
  6. </div>
  7. <p style="margin-bottom:1em;">
  8. <i><span style="color:red;font-weight:bold;">*</span> <?= t('Indicates a template that has been modified from the core version.') ?></i>
  9. </p>
  10. <?php /* Display notices about missing/extra templates */ ?>
  11. <?php if (!empty($missing_templates)): ?>
  12. <div class="alert alert-info">
  13. <h4 style="margin-top:0;">Missing Templates</h4>
  14. <p>The following core notification templates are not available in your plugin. You can create them from the core version using the link below.</p>
  15. <ul style="list-style-type:disc;margin-left:20px;">
  16. <?php foreach ($missing_templates as $template): ?><li style="margin-bottom:5px;"><?= $template ?>.php <?= $this->url->link(t('Create from Core'), 'TemplateController', 'create', ['plugin' => 'OMITemplateModder', 'template_name' => $template], false, 'btn btn-blue btn-xs smr') ?></li>
  17. <?php endforeach ?>
  18. </ul>
  19. </div>
  20. <?php endif ?>
  21. <?php if (!empty($extra_templates)): ?>
  22. <div class="alert alert-warning">
  23. <h4 style="margin-top:0;">Extra Templates</h4>
  24. <p>The following templates exist in your plugin but not in the core application. They will be ignored during the override process.</p>
  25. <ul style="list-style-type:disc;margin-left:20px;">
  26. <?php foreach ($extra_templates as $template): ?><li><?= $template ?>.php</li>
  27. <?php endforeach ?>
  28. </ul>
  29. </div>
  30. <?php endif ?>
  31. <ul class="listing">
  32. <?php foreach ($templates as $index => $template): ?>
  33. <li>
  34. <?php
  35. $templateName = basename($template);
  36. $isModified = isset($modified_status[$templateName . '.php']);
  37. ?>
  38. <?= $this->url->link($template, 'TemplateController', 'edit', ['plugin' => 'OMITemplateModder', 'template_index' => $index]) ?><?php if ($isModified): ?><span style="color:red;font-weight:bold;">*</span><?php endif ?>
  39. </li>
  40. <?php endforeach ?>
  41. </ul>
  42. <p style="margin-top:2em;">
  43. <i>To add or remove templates, simply copy or delete the corresponding files from this plugin's Templates/notification directory.
  44. <br>They will automatically be registered for use.
  45. <br>Alternatively this plugin will show which templates are not listed and give you the option to add them [create from core].</i>
  46. </p>