plugins.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. include 'common.php';
  3. include 'header.php';
  4. include 'menu.php';
  5. ?>
  6. <div class="main">
  7. <div class="body container">
  8. <?php include 'page-title.php'; ?>
  9. <div class="row typecho-page-main" role="main">
  10. <div class="col-mb-12 typecho-list">
  11. <?php \Widget\Plugins\Rows::allocWithAlias('activated', 'activated=1')->to($activatedPlugins); ?>
  12. <?php if ($activatedPlugins->have() || !empty($activatedPlugins->activatedPlugins)): ?>
  13. <h4 class="typecho-list-table-title"><?php _e('启用的插件'); ?></h4>
  14. <div class="typecho-table-wrap">
  15. <table class="typecho-list-table">
  16. <colgroup>
  17. <col width="25%"/>
  18. <col width="45%"/>
  19. <col width="8%" class="kit-hidden-mb"/>
  20. <col width="10%" class="kit-hidden-mb"/>
  21. <col width=""/>
  22. </colgroup>
  23. <thead>
  24. <tr>
  25. <th><?php _e('名称'); ?></th>
  26. <th><?php _e('描述'); ?></th>
  27. <th class="kit-hidden-mb"><?php _e('版本'); ?></th>
  28. <th class="kit-hidden-mb"><?php _e('作者'); ?></th>
  29. <th><?php _e('操作'); ?></th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php while ($activatedPlugins->next()): ?>
  34. <tr id="plugin-<?php $activatedPlugins->name(); ?>">
  35. <td><?php $activatedPlugins->title(); ?>
  36. <?php if (!$activatedPlugins->dependence): ?>
  37. <i class="i-delete"
  38. title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>"></i>
  39. <?php endif; ?>
  40. </td>
  41. <td><?php $activatedPlugins->description(); ?></td>
  42. <td class="kit-hidden-mb"><?php $activatedPlugins->version(); ?></td>
  43. <td class="kit-hidden-mb"><?php echo empty($activatedPlugins->homepage) ? $activatedPlugins->author : '<a href="' . $activatedPlugins->homepage
  44. . '">' . $activatedPlugins->author . '</a>'; ?></td>
  45. <td>
  46. <?php if ($activatedPlugins->activate || $activatedPlugins->deactivate || $activatedPlugins->config || $activatedPlugins->personalConfig): ?>
  47. <?php if ($activatedPlugins->config): ?>
  48. <a href="<?php $options->adminUrl('options-plugin.php?config=' . $activatedPlugins->name); ?>"><?php _e('设置'); ?></a>
  49. &bull;
  50. <?php endif; ?>
  51. <a lang="<?php _e('你确认要禁用插件 %s 吗?', $activatedPlugins->name); ?>"
  52. href="<?php $security->index('/action/plugins-edit?deactivate=' . $activatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
  53. <?php else: ?>
  54. <span class="important"><?php _e('即插即用'); ?></span>
  55. <?php endif; ?>
  56. </td>
  57. </tr>
  58. <?php endwhile; ?>
  59. <?php if (!empty($activatedPlugins->activatedPlugins)): ?>
  60. <?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?>
  61. <tr>
  62. <td><?php echo $key; ?></td>
  63. <td colspan="3"><span
  64. class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
  65. <td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>"
  66. href="<?php $security->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a>
  67. </td>
  68. </tr>
  69. <?php endforeach; ?>
  70. <?php endif; ?>
  71. </tbody>
  72. </table>
  73. </div>
  74. <?php endif; ?>
  75. <?php \Widget\Plugins\Rows::allocWithAlias('unactivated', 'activated=0')->to($deactivatedPlugins); ?>
  76. <?php if ($deactivatedPlugins->have() || !$activatedPlugins->have()): ?>
  77. <h4 class="typecho-list-table-title"><?php _e('禁用的插件'); ?></h4>
  78. <div class="typecho-table-wrap">
  79. <table class="typecho-list-table deactivate">
  80. <colgroup>
  81. <col width="25%"/>
  82. <col width="45%"/>
  83. <col width="8%" class="kit-hidden-mb"/>
  84. <col width="10%" class="kit-hidden-mb"/>
  85. <col width=""/>
  86. </colgroup>
  87. <thead>
  88. <tr>
  89. <th><?php _e('名称'); ?></th>
  90. <th><?php _e('描述'); ?></th>
  91. <th class="kit-hidden-mb"><?php _e('版本'); ?></th>
  92. <th class="kit-hidden-mb"><?php _e('作者'); ?></th>
  93. <th class="typecho-radius-topright"><?php _e('操作'); ?></th>
  94. </tr>
  95. </thead>
  96. <tbody>
  97. <?php if ($deactivatedPlugins->have()): ?>
  98. <?php while ($deactivatedPlugins->next()): ?>
  99. <tr id="plugin-<?php $deactivatedPlugins->name(); ?>">
  100. <td><?php $deactivatedPlugins->title(); ?></td>
  101. <td><?php $deactivatedPlugins->description(); ?></td>
  102. <td class="kit-hidden-mb"><?php $deactivatedPlugins->version(); ?></td>
  103. <td class="kit-hidden-mb"><?php echo empty($deactivatedPlugins->homepage) ? $deactivatedPlugins->author : '<a href="' . $deactivatedPlugins->homepage
  104. . '">' . $deactivatedPlugins->author . '</a>'; ?></td>
  105. <td>
  106. <a href="<?php $security->index('/action/plugins-edit?activate=' . $deactivatedPlugins->name); ?>"><?php _e('启用'); ?></a>
  107. </td>
  108. </tr>
  109. <?php endwhile; ?>
  110. <?php else: ?>
  111. <tr>
  112. <td colspan="5"><h6 class="typecho-list-table-title"><?php _e('没有安装插件'); ?></h6>
  113. </td>
  114. </tr>
  115. <?php endif; ?>
  116. </tbody>
  117. </table>
  118. </div>
  119. <?php endif; ?>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <?php
  125. include 'copyright.php';
  126. include 'common-js.php';
  127. include 'footer.php';
  128. ?>