Mailchimp_Gallery

The Mailchimp Subscription Form Mailchimp Gallery class.

Defined (1)

The class is defined in the following location(s).

/classes/mailchimp/Mailchimp/Gallery.php  
  1. class Mailchimp_Gallery { 
  2. public function __construct(NM_Mailchimp $master) { 
  3. $this->master = $master; 
  4.  
  5. /** 
  6. * Return a section of the image gallery 
  7. * @param associative_array $opts 
  8. * - type string optional the gallery type to return - images or files - default to images 
  9. * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0) 
  10. * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100 
  11. * - sort_by string optional field to sort by - one of size, time, name - defaults to time 
  12. * - sort_dir string optional field to sort by - one of asc, desc - defaults to desc 
  13. * - search_term string optional a term to search for in names 
  14. * - folder_id int optional to return files that are in a specific folder. id returned by the list-folders call 
  15. * @return associative_array the matching gallery items 
  16. * - total int the total matching items 
  17. * - data array structs for each item included in the set, including: 
  18. * - id int the id of the file 
  19. * - name string the file name 
  20. * - time string the creation date for the item 
  21. * - size int the file size in bytes 
  22. * - full string the url to the actual item in the gallery 
  23. * - thumb string a url for a thumbnail that can be used to represent the item, generally an image thumbnail or an icon for a file type 
  24. */ 
  25. public function getList($opts=array()) { 
  26. $_params = array("opts" => $opts); 
  27. return $this->master->call('gallery/list', $_params); 
  28.  
  29. /** 
  30. * Return a list of the folders available to the file gallery 
  31. * @param associative_array $opts 
  32. * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0) 
  33. * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100 
  34. * - search_term string optional a term to search for in names 
  35. * @return associative_array the matching gallery folders 
  36. * - total int the total matching folders 
  37. * - data array structs for each folder included in the set, including: 
  38. * - id int the id of the folder 
  39. * - name string the file name 
  40. * - file_count int the number of files in the folder 
  41. */ 
  42. public function listFolders($opts=array()) { 
  43. $_params = array("opts" => $opts); 
  44. return $this->master->call('gallery/list-folders', $_params); 
  45.  
  46. /** 
  47. * Adds a folder to the file gallery 
  48. * @param string $name 
  49. * @return associative_array the new data for the created folder 
  50. * - data.id int the id of the new folder 
  51. */ 
  52. public function addFolder($name) { 
  53. $_params = array("name" => $name); 
  54. return $this->master->call('gallery/add-folder', $_params); 
  55.  
  56. /** 
  57. * Remove a folder 
  58. * @param int $folder_id 
  59. * @return boolean true/false for success/failure 
  60. */ 
  61. public function removeFolder($folder_id) { 
  62. $_params = array("folder_id" => $folder_id); 
  63. return $this->master->call('gallery/remove-folder', $_params); 
  64.  
  65. /** 
  66. * Add a file to a folder 
  67. * @param int $file_id 
  68. * @param int $folder_id 
  69. * @return boolean true/false for success/failure 
  70. */ 
  71. public function addFileToFolder($file_id, $folder_id) { 
  72. $_params = array("file_id" => $file_id, "folder_id" => $folder_id); 
  73. return $this->master->call('gallery/add-file-to-folder', $_params); 
  74.  
  75. /** 
  76. * Remove a file from a folder 
  77. * @param int $file_id 
  78. * @param int $folder_id 
  79. * @return boolean true/false for success/failure 
  80. */ 
  81. public function removeFileFromFolder($file_id, $folder_id) { 
  82. $_params = array("file_id" => $file_id, "folder_id" => $folder_id); 
  83. return $this->master->call('gallery/remove-file-from-folder', $_params); 
  84.  
  85. /** 
  86. * Remove all files from a folder (Note that the files are not deleted, they are only removed from the folder) 
  87. * @param int $folder_id 
  88. * @return boolean true/false for success/failure 
  89. */ 
  90. public function removeAllFilesFromFolder($folder_id) { 
  91. $_params = array("folder_id" => $folder_id); 
  92. return $this->master->call('gallery/remove-all-files-from-folder', $_params); 
  93.