PageRenderTime 54ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/types/library/otgs/installer/templates/downloads-list.php

https://gitlab.com/Fraternal-Group/fraternal
PHP | 85 lines | 75 code | 10 blank | 0 comment | 6 complexity | dcf3de58f197f7e606faf1cf87272ef4 MD5 | raw file
  1. <br clear="all" /><br />
  2. <strong><?php _e('Downloads:', 'installer') ?></strong>
  3. <form method="post" class="otgsi_downloads_form">
  4. <table class="widefat">
  5. <thead>
  6. <tr>
  7. <th>&nbsp;</th>
  8. <th><?php _e('Plugin', 'installer') ?></th>
  9. <th><?php _e('Current version', 'installer') ?></th>
  10. <th><?php _e('Released', 'installer') ?></th>
  11. <th><?php _e('Installed version', 'installer') ?></th>
  12. <th>&nbsp;</th>
  13. <th>&nbsp;</th>
  14. <th>&nbsp;</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. <?php
  19. foreach($package['downloads'] as $download): ?>
  20. <tr>
  21. <td>
  22. <label>
  23. <?php
  24. $url = $this->append_site_key_to_download_url($download['url'], $site_key, $repository_id);
  25. $download_data = array(
  26. 'url' => $url,
  27. 'slug' => $download['slug'],
  28. 'nonce' => wp_create_nonce('install_plugin_' . $url),
  29. 'repository_id' => $repository_id
  30. );
  31. ?>
  32. <input type="checkbox" name="downloads[]" value="<?php echo base64_encode(json_encode($download_data)); ?>" <?php
  33. if($this->plugin_is_installed($download['name'], $download['slug'], $download['version']) && !$this->plugin_is_embedded_version($download['name'], $download['slug']) || WP_Installer()->dependencies->cant_download($repository_id) ): ?>disabled="disabled"<?php endif; ?> />&nbsp;
  34. </label>
  35. </td>
  36. <td class="installer_plugin_name"><?php echo $download['name'] ?></td>
  37. <td><?php echo $download['version'] ?></td>
  38. <td><?php echo date_i18n('F j, Y', strtotime($download['date'])) ?></td>
  39. <td class="installer_version_installed">
  40. <?php if($v = $this->plugin_is_installed($download['name'], $download['slug'])): $class = version_compare($v, $download['version'], '>=') ? 'installer-green-text' : 'installer-red-text'; ?>
  41. <span class="<?php echo $class ?>"><?php echo $v; ?></span>
  42. <?php if($this->plugin_is_embedded_version($download['name'], $download['slug'])): ?>&nbsp;<?php _e('(embedded)', 'installer'); ?><?php endif; ?>
  43. <?php endif; ?>
  44. </td>
  45. <td>
  46. <span class="installer-status-installing"><?php _e('installing...', 'installer') ?></span>
  47. <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
  48. <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
  49. <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
  50. </td>
  51. <td>
  52. <span class="installer-status-activating"><?php _e('activating', 'installer') ?></span>
  53. <span class="installer-status-activated"><?php _e('activated', 'installer') ?></span>
  54. </td>
  55. <td class="for_spinner_js"><span class="spinner"></span></td>
  56. </tr>
  57. <?php endforeach; ?>
  58. </tbody>
  59. </table>
  60. <br />
  61. <div class="installer-error-box">
  62. <?php if( !WP_Installer()->dependencies->is_uploading_allowed() ): ?>
  63. <p><?php printf(__('Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s.', 'installer'),
  64. '<a href="http://codex.wordpress.org/Changing_File_Permissions">', '</a>') ?></p>
  65. <?php elseif( WP_Installer()->dependencies->is_win_paths_exception($repository_id) ): ?>
  66. <p><?php echo WP_Installer()->dependencies->win_paths_exception_message() ?></p>
  67. <?php endif; ?>
  68. </div>
  69. <input type="submit" class="button-secondary" value="<?php esc_attr_e('Download', 'installer') ?>" disabled="disabled" />
  70. &nbsp;
  71. <label><input name="activate" type="checkbox" value="1" disabled="disabled" />&nbsp;<?php _e('Activate after download', 'installer') ?></label>
  72. <div class="installer-download-progress-status"></div>
  73. <div class="installer-status-success"><?php _e('Operation complete!', 'installer') ?></div>
  74. <span class="installer-revalidate-message hidden"><?php _e("Download failed!\n\nPlease refresh the page and try again.", 'installer') ?></span>
  75. </form>