redac_list.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. # ***** BEGIN LICENSE BLOCK *****
  3. # This file is part of DotClear.
  4. # Copyright (c) 2004 Olivier Meunier and contributors. All rights
  5. # reserved.
  6. #
  7. # DotClear is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # DotClear is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with DotClear; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. #
  21. # ***** END LICENSE BLOCK *****
  22. require dirname(__FILE__).'/inc/prepend.php';
  23. $auth->check(9);
  24. include dirname(__FILE__).'/inc/connexion.php';
  25. $mySubMenu->addItem('<strong>'.__('New editor').'</strong>','redacteur.php','images/ico_new.png',false);
  26. openPage(__('List of editors'));
  27. echo '<h2>'.__('List of editors').'</h2>';
  28. $rsUser = $blog->getUser();
  29. while(!$rsUser->EOF())
  30. {
  31. $user_level = $rsUser->field('user_level');
  32. $user_nb_post = $rsUser->field('nb_post');
  33. if ($user_level == 9) {
  34. $user_level = __('administrator');
  35. } elseif ($user_level == 5) {
  36. $user_level = __('advanced editor');
  37. } elseif ($user_level == 1) {
  38. $user_level = __('editor');
  39. } elseif ($user_level == 0) {
  40. $user_level = __('inactive');
  41. }
  42. $style = ($rsUser->f('user_level') == 0) ? ' style="color:#999;"' : '';
  43. echo '<div class="ligne clear"'.$style.'>'.
  44. '<h3 class="ligneTitre">'.$rsUser->field('user_id').'</h3>'.
  45. '<p class="semi">'.
  46. $rsUser->field('user_prenom').' '.$rsUser->field('user_nom').
  47. ' ('.$user_level.')'.
  48. ' [ <strong><a href="redacteur.php?id='.rawurlencode($rsUser->field('user_id')).'">'.
  49. __('edit').'</a></strong> - ';
  50. if ($user_nb_post > 0) {
  51. echo $user_nb_post.' billet';
  52. echo ($user_nb_post > 1) ? 's' : '';
  53. } else {
  54. echo '<a href="redacteur.php?id='.rawurlencode($rsUser->field('user_id')).'&amp;del=1"'.
  55. 'onclick="return window.confirm(\''.__('Are you sure you want to delete this editor?').'\')">'.
  56. __('delete').'</a>';
  57. }
  58. echo ' ]</p></div>';
  59. $rsUser->moveNext();
  60. }
  61. closePage();
  62. ?>