view.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Views the progress bar, statistics and run button for an upgrade
  4. */
  5. $count = elgg_extract('count', $vars);
  6. $action = elgg_extract('action', $vars);
  7. if (!$count) {
  8. echo elgg_echo('upgrade:finished');
  9. return;
  10. }
  11. elgg_load_js('elgg.upgrades');
  12. $warning_string = '';
  13. if ($count > 1000) {
  14. $warning_string = elgg_echo('upgrade:warning');
  15. }
  16. $status_string = elgg_echo('upgrade:item_count', array($count));
  17. $success_count_string = elgg_echo('upgrade:success_count');
  18. $error_count_string = elgg_echo('upgrade:error_count');
  19. $action_link = elgg_view('output/url', array(
  20. 'text' => elgg_echo('upgrade'),
  21. 'href' => $action,
  22. 'class' => 'elgg-button elgg-button-action mtl',
  23. 'is_action' => true,
  24. 'id' => 'upgrade-run',
  25. ));
  26. echo <<<HTML
  27. <p>$warning_string</p>
  28. <p>$status_string</p>
  29. <span id="upgrade-total" class="hidden">$count</span>
  30. <span id="upgrade-count" class="hidden">0</span>
  31. <span id="upgrade-action" class="hidden">$action</span>
  32. <div class="elgg-progressbar mvl"><span class="elgg-progressbar-counter" id="upgrade-counter">0%</span></div>
  33. <ul class="mvl">
  34. <li>$success_count_string <span id="upgrade-success-count">0</span></li>
  35. <li>$error_count_string <span id="upgrade-error-count">0</span></li>
  36. </ul>
  37. <div id="upgrade-spinner" class="elgg-ajax-loader hidden"></div>
  38. <ul class="mvl" id="upgrade-messages"></ul>
  39. $action_link
  40. HTML;