/plugin/PBAPI/PBAPI/Methods/media.php

https://bitbucket.org/chamilo/chamilo-ext-repo-photobucket-dev/ · PHP · 133 lines · 54 code · 12 blank · 67 comment · 3 complexity · 5f5b1f5a8b6e55a4f8eac113981254c0 MD5 · raw file

  1. <?php
  2. use common\libraries\Path;
  3. /**
  4. * Photobucket API
  5. * Fluent interface for PHP5
  6. * Media methods
  7. *
  8. * @author Photobucket
  9. * @package PBAPI
  10. * @subpackage Methods
  11. *
  12. * @copyright Copyright Copyright (c) 2008, Photobucket, Inc.
  13. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  14. */
  15. /**
  16. * Load Methods parent
  17. */
  18. require_once dirname(__FILE__) . '/../Methods.php';
  19. /**
  20. * Media methods
  21. *
  22. * @package PBAPI
  23. * @subpackage Methods
  24. */
  25. class PBAPI_Methods_media extends PBAPI_Methods
  26. {
  27. /**
  28. * description
  29. *
  30. * @param array $params
  31. */
  32. public function description($params = null)
  33. {
  34. $this->core->_setParamList($params);
  35. $this->core->_appendUri('/description');
  36. }
  37. /**
  38. * Title
  39. *
  40. * @param array $params
  41. */
  42. public function title($params = null)
  43. {
  44. $this->core->_setParamList($params);
  45. $this->core->_appendUri('/title');
  46. }
  47. /**
  48. * Tag
  49. *
  50. * @param int $tagid [optional, default=all] tag id, '' for all tags
  51. * @param array $params array(...)
  52. */
  53. public function tag($tagid = '', $params = null)
  54. {
  55. if (is_array($tagid) && $params == null)
  56. {
  57. $params = $tagid;
  58. $tagid = '';
  59. }
  60. $this->core->_appendUri('/tag/%s', $tagid);
  61. $this->core->_setParamList($params);
  62. }
  63. /**
  64. * resize
  65. *
  66. * @param array $params
  67. */
  68. public function resize($params)
  69. {
  70. $this->core->_setParamList($params);
  71. $this->core->_appendUri('/resize');
  72. }
  73. /**
  74. * Rotate
  75. *
  76. * @param array $params
  77. */
  78. public function rotate($params)
  79. {
  80. $this->core->_setParamList($params);
  81. $this->core->_appendUri('/rotate');
  82. }
  83. /**
  84. * Metadata
  85. *
  86. * @param array $params
  87. */
  88. public function meta($params = null)
  89. {
  90. $this->core->_appendUri('/meta');
  91. }
  92. /**
  93. * Links
  94. *
  95. * @param array $params
  96. */
  97. public function links($params = null)
  98. {
  99. $this->core->_appendUri('/link');
  100. }
  101. /**
  102. * related search
  103. *
  104. * @param array $params
  105. */
  106. public function related($params = null)
  107. {
  108. $this->core->_setParamList($params);
  109. $this->core->_appendUri('/related');
  110. }
  111. /**
  112. * Share
  113. *
  114. * @param array $params
  115. */
  116. public function share($params)
  117. {
  118. $this->core->_setParamList($params);
  119. $this->core->_appendUri('/share');
  120. }
  121. }