PageRenderTime 66ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/skyblue/managers/users/views/list.usergroups.php

https://github.com/iconifyit/SkyBlue-CMS
PHP | 112 lines | 94 code | 7 blank | 11 comment | 7 complexity | df3681b44321e67a70f8e478f67ab4c1 MD5 | raw file
  1. <?php defined('SKYBLUE') or die('Bad file request');
  2. /**
  3. * @version v 1.1 2009-04-19 10:37:00 $
  4. * @package SkyBlueCanvas
  5. * @copyright Copyright (C) 2005 - 2010 Scott Edwin Lewis. All rights reserved.
  6. * @license GNU/GPL, see COPYING.txt
  7. * SkyBlueCanvas is free software. This version may have been modified pursuant
  8. * to the GNU General Public License, and as distributed it includes or
  9. * is derivative of works licensed under the GNU General Public License or
  10. * other free or open source software licenses.
  11. * See COPYING.txt for copyright notices and details.
  12. */
  13. $data = $this->getData();
  14. $count = count($data);
  15. $pageCount = $this->getVar('pageCount');
  16. $pageNum = $this->getVar('pageNum');
  17. ?>
  18. <style type="text/css">
  19. table td img, table td a img {border: none !important;}
  20. .buttons-top {text-align: right;}
  21. </style>
  22. <div class="jquery_tab">
  23. <div class="content">
  24. <h2>
  25. <a href="admin.php?com=console"><?php __('COM.CONSOLE', 'Dashboard'); ?></a> /
  26. <a href="admin.php?com=settings"><?php __('COM.SETTINGS', 'Settings'); ?></a> /
  27. <?php __('COM.USERS.GROUPS', 'User Groups'); ?>
  28. </h2>
  29. <?php echo HtmlUtils::formatMessage($this->getMessage()); ?>
  30. <p class="buttons-top">
  31. <?php HtmlUtils::mgrActionLink('USERS.BTN.VIEWUSERS', 'admin.php?com=users'); ?>
  32. <?php HtmlUtils::mgrActionLink('USERS.BTN.NEWGROUP', 'admin.php?com=users&action=addgroup'); ?>
  33. </p>
  34. <table id="table_liquid" cellspacing="0">
  35. <?php
  36. HtmlUtils::mgrThead(array(
  37. __('GLOBAL.NAME', 'Name', 1),
  38. __('GLOBAL.TASKS', 'Tasks', 1)
  39. ));
  40. ?>
  41. <?php if (!count($data)) : ?>
  42. <tr>
  43. <td colspan="3"><?php __('GLOBAL.NO_ITEMS', 'No items to display'); ?></td>
  44. </tr>
  45. <?php else : ?>
  46. <?php $i=0; ?>
  47. <?php foreach ($data as $item) : ?>
  48. <tr class="<?php echo ($i % 2 == 0) ? 'even' : 'odd' ; ?>">
  49. <td><?php echo $item->getName(); ?></td>
  50. <td width="125">
  51. <?php
  52. HtmlUtils::mgrTask(
  53. 'users',
  54. 'editgroup',
  55. $item->getId(),
  56. $item->getName(),
  57. 'pencil',
  58. array(
  59. 'title' => __("TASKS.EDIT", 'Edit', 1) . " " . $item->getName()
  60. ),
  61. $params
  62. );
  63. ?>
  64. <?php if ($count > 1) : ?>
  65. <?php
  66. HtmlUtils::mgrTask(
  67. 'users',
  68. 'deletegroup',
  69. $item->getId(),
  70. $item->getName(),
  71. 'closethick',
  72. array(
  73. 'onclick' => "confirm_delete(event, '{$item->getName()}', true, 'admin.php?com=users&action=deletegroup&id={$item->getId()}');",
  74. 'title' => __("TASKS.DELETE", 'Delete', 1) . " " . $item->getName()
  75. ),
  76. $params
  77. );
  78. ?>
  79. <?php endif; ?>
  80. </td>
  81. </tr>
  82. <?php $i++; ?>
  83. <?php endforeach; ?>
  84. <?php if ($pageCount > 1) : ?>
  85. <tfoot>
  86. <tr>
  87. <td colspan="4" align="right">
  88. <ul class="pagination">
  89. <?php for ($n=1; $n<=$pageCount; $n++) : ?>
  90. <?php $active = $pageNum == $n ? ' ui-state-active' : '' ; ?>
  91. <li class="ui-state-default ui-corner-all<?php echo $active; ?>"><a href="admin.php?com=users&action=list&pageNum=<?php echo $n; ?>"><?php echo $n; ?></a></li>
  92. <?php endfor; ?>
  93. </ul>
  94. </td>
  95. </tr>
  96. </tfoot>
  97. <?php endif; ?>
  98. <?php endif; ?>
  99. </table>
  100. <p class="buttons-bottom">
  101. <?php HtmlUtils::mgrActionLink('USERS.BTN.VIEWUSERS', 'admin.php?com=users'); ?>
  102. <?php HtmlUtils::mgrActionLink('USERS.BTN.NEWGROUP', 'admin.php?com=users&action=addgroup'); ?>
  103. </p>
  104. </div>
  105. </div>