Disposition.class.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Disposition.class.php
  4. *
  5. * This file contains functions needed to handle content disposition headers
  6. * in mime messages. See RFC 2183.
  7. *
  8. * @copyright 2003-2025 The SquirrelMail Project Team
  9. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10. * @version $Id$
  11. * @package squirrelmail
  12. * @subpackage mime
  13. * @since 1.3.2
  14. */
  15. /**
  16. * Class that handles content disposition header
  17. * @package squirrelmail
  18. * @subpackage mime
  19. * @since 1.3.0
  20. */
  21. class Disposition {
  22. var $name;
  23. var $properties;
  24. /**
  25. * Constructor (PHP5 style, required in some future version of PHP)
  26. * @param string $name
  27. */
  28. function __construct($name) {
  29. $this->name = $name;
  30. $this->properties = array();
  31. }
  32. /**
  33. * Constructor (PHP4 style, kept for compatibility reasons)
  34. * @param string $name
  35. */
  36. function Disposition($name) {
  37. self::__construct($name);
  38. }
  39. /**
  40. * Returns value of content disposition property
  41. * @param string $par content disposition property name
  42. * @return string
  43. * @since 1.3.1
  44. */
  45. function getProperty($par) {
  46. $par = strtolower($par);
  47. if (isset($this->properties[$par])) {
  48. return $this->properties[$par];
  49. }
  50. return '';
  51. }
  52. }