edit_cat.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. $id = $_REQUEST['id'];
  23. $strReq = 'SELECT title '.
  24. 'FROM '.$blogroll->table.' '.
  25. 'WHERE link_id = '.$id;
  26. $rs = $con->select($strReq);
  27. $c_title = $rs->f('title');
  28. if (!$rs->isEmpty() && $action == 'edit_cat')
  29. {
  30. $c_title = trim($_POST['l_title']);
  31. if ($c_title)
  32. {
  33. if ($blogroll->updCat($id,$c_title) == false) {
  34. $err = $blogroll->con->error();
  35. } else {
  36. header('Location: '.$url);
  37. exit;
  38. }
  39. }
  40. }
  41. # Affichage
  42. $mySubMenu->addItem(
  43. '<strong>'.__('Back').'</strong>',array($url),$icon,false);
  44. buffer::str('<h2>'.__('Edit rubric').'</h2>');
  45. if ($err != '') {
  46. buffer::str(
  47. '<div class="erreur"><p><strong>'.__('Error(s)').' :</strong></p>'.
  48. '<p>'.$err.'</p>'.
  49. '</div>'
  50. );
  51. }
  52. if ($rs->isEmpty())
  53. {
  54. buffer::str('<p>'.__('No link').'</p>');
  55. }
  56. else
  57. {
  58. buffer::str(
  59. '<form action="'.$url.'" method="post">'.
  60. '<fieldset><legend>'.__('Edit rubric').'</legend>'.
  61. '<p class="field"><strong>'.
  62. '<label for="l_title" class="float">'.__('Title').' : </label></strong>'.
  63. form::field('l_title',40,255,htmlspecialchars($c_title)).'</p>'.
  64. '<p>'.form::hidden('action','edit_cat').
  65. form::hidden('page','edit_cat').
  66. form::hidden('id',$id).
  67. '<input type="submit" class="submit" value="'.__('save').'"/></p>'.
  68. '</fieldset>'.
  69. '</form>'
  70. );
  71. }
  72. ?>