/application/modules/Storage/views/scripts/admin-services/index.tpl

https://github.com/grandison/budo16 · Smarty Template · 130 lines · 116 code · 14 blank · 0 comment · 2 complexity · c2926c16db2918bdb33503c7153c629b MD5 · raw file

  1. <?php
  2. /**
  3. * SocialEngine
  4. *
  5. * @category Application_Core
  6. * @package Payment
  7. * @copyright Copyright 2006-2010 Webligo Developments
  8. * @license http://www.socialengine.net/license/
  9. * @version $Id: index.tpl 8391 2011-02-03 23:54:06Z john $
  10. * @author John Boehr <j@webligo.com>
  11. */
  12. ?>
  13. <h2>
  14. <?php echo $this->translate("Manage Storage Services") ?>
  15. </h2>
  16. <p>
  17. <?php echo $this->translate("STORAGE_VIEWS_ADMIN_SERVICES_INDEX_DESCRIPTION") ?>
  18. </p>
  19. <br />
  20. <div>
  21. <?php echo $this->htmlLink(array('action' => 'create', 'reset' => false), $this->translate('Add Service'), array(
  22. 'class' => 'buttonlink',
  23. 'style' => 'background-image: url(application/modules/Storage/externals/images/admin/add.png);'
  24. )) ?>
  25. </div>
  26. <br />
  27. <div class='admin_results'>
  28. <div>
  29. <?php $count = $this->paginator->getTotalItemCount() ?>
  30. <?php echo $this->translate(array("%s service found",
  31. "%s services found", $count), $this->locale()->toNumber($count)) ?>
  32. </div>
  33. <?php echo $this->paginationControl($this->paginator, null, null, array(
  34. 'query' => $this->filterValues,
  35. 'pageAsQuery' => true,
  36. )); ?>
  37. </div>
  38. <br />
  39. <script type="text/javascript">
  40. function setDefaultStorageService(service_id) {
  41. $$('input[type=radio]').set('disabled', true);
  42. var req = new Request.JSON({
  43. 'format': 'json',
  44. 'url' : '<?php echo $this->url(array('action' => 'set-default')) ?>',
  45. 'data' : {
  46. 'format' : 'json',
  47. 'service_id' : service_id
  48. },
  49. 'onSuccess' : function(responseJSON, responseText) {
  50. window.location.reload();
  51. }
  52. });
  53. req.send();
  54. }
  55. </script>
  56. <table class='admin_table'>
  57. <thead>
  58. <tr>
  59. <th style='width: 1%;'>
  60. <?php echo $this->translate("ID") ?>
  61. </th>
  62. <th>
  63. <?php echo $this->translate("Title") ?>
  64. </th>
  65. <th style='width: 1%;'>
  66. <?php echo $this->translate('Files') ?>
  67. </th>
  68. <th>
  69. <?php echo $this->translate('Storage Used') ?>
  70. </th>
  71. <th style='width: 1%;' class='admin_table_centered'>
  72. <?php echo $this->translate("Enabled") ?>
  73. </th>
  74. <th style='width: 1%;' class='admin_table_centered'>
  75. <?php echo $this->translate("Default") ?>
  76. </th>
  77. <th style='width: 1%;' class='admin_table_options'><?php echo $this->translate("Options") ?></th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <?php if( count($this->paginator) ): ?>
  82. <?php foreach( $this->paginator as $item ): ?>
  83. <tr>
  84. <td>
  85. <?php echo $this->locale()->toNumber($item->service_id) ?>
  86. </td>
  87. <td class='admin_table_bold'>
  88. <?php echo $this->translate($this->serviceTypes[$item->servicetype_id]['title']) ?>
  89. </td>
  90. <td class='admin_table_centered'>
  91. <?php echo $this->locale()->toNumber($this->serviceFileInfo[$item->service_id]['count']) ?>
  92. </td>
  93. <td style="width: 1%; white-space: nowrap;">
  94. <?php echo $this->translate('%s bytes',
  95. $this->locale()->toNumber($this->serviceFileInfo[$item->service_id]['size'])) ?>
  96. </td>
  97. <td class='admin_table_centered'>
  98. <?php echo ( $item->enabled ? $this->translate('Yes') : $this->translate('No') ) ?>
  99. </td>
  100. <td class='admin_table_centered'>
  101. <?php if( $item->default ): ?>
  102. <img src="application/modules/Core/externals/images/notice.png" alt="Default" />
  103. <?php else: ?>
  104. <?php echo $this->formRadio('default', $item->service_id, array('onchange' => "setDefaultStorageService({$item->service_id});",'disable'=>!$item->enabled), '') ?>
  105. <?php endif; ?>
  106. </td>
  107. <td class='admin_table_options'>
  108. <a href='<?php echo $this->url(array('action' => 'edit', 'service_id' => $item->service_id)) ?>'>
  109. <?php echo $this->translate("edit") ?>
  110. </a>
  111. </td>
  112. </tr>
  113. <?php endforeach; ?>
  114. <?php endif; ?>
  115. </tbody>
  116. </table>