Document Upload by Fbsmp module and show it in status direclty

Public

Put the document.inc file under sites/all/modules/fbsmp/plugins/document.inc
We are using download_file module to theme the file display as direct download link,so you need to install download_file module

</> CopyGet raw version
php
  1. <?php
  2.  
  3. /**
  4.  * @file
  5.  * Allows users to attach documents with their FBSS status.
  6.  */
  7.  
  8. fbsmp_include_library('file.inc', 'file');
  9.  
  10. module_load_include('inc', 'download_file', 'download_file.formatter');
  11. /**
  12.  * Implementation of hook_fbsmp_admin_settings_form().
  13.  */
  14. function fbsmp_document_fbsmp_admin_settings_form(&$form_state) {//echo '<pre>';print_r("test");die();
  15. $prev_settings = fbsmp_load_plugin_settings('document');
  16. $form = array();
  17. $form['general'] = array(
  18. '#type' => 'fieldset',
  19. '#title' => t('General settings'),
  20. '#collapsible' => FALSE,
  21. );
  22. $form['general']['file_extensions'] = array(
  23. '#type' => 'textfield',
  24. '#title' => t('Permitted upload file extensions'),
  25. '#default_value' => $prev_settings['file_extensions'],
  26. '#size' => 64,
  27. '#description' => t('Extensions a user can upload to this field. Separate extensions with a space and do not include the leading dot. Leaving this blank will allow users to upload a file with any extension.'),
  28. );
  29.  
  30. $form['general']['max_filesize'] = array(
  31. '#type' => 'textfield',
  32. '#title' => t('Maximum upload size per file'),
  33. '#default_value' => $prev_settings['max_filesize'],
  34. '#description' => t('Specify the size limit that applies to each file separately. Enter a value like "512" (bytes), "80K" (kilobytes) or "50M" (megabytes) in order to restrict the allowed file size. If you leave this this empty the file sizes will be limited only by PHP\'s maximum post and file upload sizes (current limit <strong>%limit</strong>).', array('%limit' => format_size(file_upload_max_size()))),
  35. );
  36.  
  37. $form['path_settings'] = array(
  38. '#type' => 'fieldset',
  39. '#title' => t('Path settings'),
  40. '#collapsible' => TRUE,
  41. '#collapsed' => TRUE,
  42. );
  43. // TODO Please change this theme call to use an associative array for the $variables parameter.
  44. $form['path_settings']['file_path'] = array(
  45. '#type' => 'textfield',
  46. '#title' => t('File path'),
  47. '#default_value' => $prev_settings['file_path'],
  48. '#description' => t('Optional subdirectory within the "%directory" directory where document files will be stored. Do not include preceding or trailing slashes.', array('%directory' => variable_get('file_directory_path', 'files') . '/')),
  49. '#suffix' => theme('token_help', 'user'),
  50. );
  51.  
  52. return $form;
  53. }
  54.  
  55. /**
  56.  * Implementation of hook_fbsmp_admin_settings_form_validate().
  57.  */
  58. function fbsmp_document_fbsmp_admin_settings_form_validate(&$form, &$form_state) {
  59. // Check that only files are specified in the callback.
  60. $form_values = $form_state['values'];
  61. $extensions = array_filter(explode(' ', $form_values['file_extensions']));
  62. $web_extensions = array('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'rtf', 'txt', 'pdf', 'psd', 'mp3', 'wma', 'odt', 'odc', 'odp', 'odg', 'zip', 'rar', 'gz', '7z', 'mmap');
  63. if (count(array_diff($extensions, $web_extensions))) {
  64. form_set_error('file_extensions', t('Only common office files (doc, docx, ppt, pptx, xls, xlsx, rtf, txt, pdf, psd, mp3, wma, odt, odc, odp, odg, zip, rar, gz, 7z, and mmap) are supported through the document plugin.'));
  65. }
  66. //Check that set filesize is valid
  67. if (!empty($form_values['max_filesize']) && !is_numeric(parse_size($form_values['max_filesize']))) {
  68. form_set_error('max_filesize', t('The "Maximum upload size" option must contain a valid value. You can either leave the text field empty or enter a string like "512" (bytes), "80K" (kilobytes) or "50M" (megabytes).'));
  69. }
  70.  
  71. //Check the validity of the file path.
  72. //Strip slashes from the beginning and end of $widget['file_path']
  73. $form_values['file_path'] = trim($form_values['file_path'], '\\/');
  74.  
  75. //Do not allow the file path to be the same as the file_directory_path().
  76. //This causes all sorts of problems with things like file_create_url().
  77. if (strpos($form_values['file_path'], file_default_scheme() . ':/' ) === 0) {
  78. form_set_error('file_path', t('The file path (@file_path) cannot start with the system files directory (@files_directory), as this may cause conflicts when building file URLs.', array('@file_path' => $form_values['file_path'], '@files_directory' => file_directory_path())));
  79. }
  80. }
  81.  
  82. /**
  83.  * Implementation of hook_fbsmp_admin_settings_form_submit().
  84.  */
  85. function fbsmp_document_fbsmp_admin_settings_form_submit(&$form, &$form_state) {
  86. $form_values = $form_state['values'];
  87. $settings = array();
  88. $settings['file_extensions'] = $form_values['file_extensions'];
  89. $settings['max_filesize'] = $form_values['max_filesize'];
  90. $settings['file_path'] = $form_values['file_path'];
  91.  
  92. fbsmp_save_plugin_settings($settings, 'document');
  93. }
  94.  
  95. /**
  96.  * Implementation of hook_fbsmp_widget_form().
  97.  */
  98. function fbsmp_document_fbsmp_widget_form(&$form_state) {
  99.  
  100. $form = array();
  101. $settings = fbsmp_load_plugin_settings('document');
  102. $settings['file_extensions'] = !empty($settings['file_extensions']) ? $settings['file_extensions'] : 'jpeg jpg png gif';
  103.  
  104. $max_filesize = parse_size(file_upload_max_size());
  105. if (!empty($settings['max_filesize']) && parse_size($settings['max_filesize']) < $max_filesize) {
  106. $max_filesize = parse_size($settings['max_filesize']);
  107. }
  108. $desc[] = t('Allowed Extensions: @ext', array('@ext' => $settings['file_extensions']));
  109. $desc[] = t('Maximum Filesize: @size', array('@size' => format_size($max_filesize)));
  110.  
  111. $form['fbsmp_document_upload'] = array(
  112. '#type' => 'file',
  113. '#description' => implode('<br />', $desc),
  114. '#size' => 22,
  115. '#upload_validators' => fbsmp_document_widget_upload_validators($settings),
  116. '#settings' => $settings,
  117. );
  118. return $form;
  119. }
  120.  
  121. /**
  122.  * Implementation of hook_fbsmp_widget_form_validate().
  123.  */
  124. function fbsmp_document_fbsmp_widget_form_validate(&$form, &$form_state) {
  125. $settings = $form['fbsmp']['fbsmp_document_upload']['#settings'];
  126. $upload_name = 'fbsmp_document_upload';
  127. //echo '<pre>';print_r($settings);die();
  128. $dest = _fbsmp_file_create_path($settings['file_path']);
  129. if (!_fbsmp_file_check_directory($dest, FILE_CREATE_DIRECTORY)) {
  130. watchdog('fbsmp', 'The upload directory %directory could not be created or is not accessible. A newly uploaded document could not be saved in this directory as a consequence, and the upload was canceled.', array('%directory' => $dest));
  131. form_set_error($upload_name, t('The document could not be uploaded. (1)'));
  132. return 0;
  133. }
  134. if ($file = _fbsmp_file_save_upload($upload_name, $form['fbsmp']['fbsmp_document_upload']['#upload_validators'], $dest)) {
  135. $form_state['values']['fbsmp_document_upload'] = $file->fid;
  136. }
  137. else {
  138. form_set_error($upload_name, t('The document could not be uploaded.(2)'));
  139. }
  140. }
  141.  
  142. /**
  143.  * Implementation of hook_fbsmp_widget_form_save().
  144.  */
  145. function fbsmp_document_fbsmp_widget_form_save($form, $form_state) {
  146. $fid = $form_state['values']['fbsmp_document_upload'];
  147. //file_set_status(_fbsmp_file_load($fid), FILE_STATUS_PERMANENT); //Cache the file.
  148. $file = _fbsmp_file_load($fid);
  149. $file->status = FILE_STATUS_PERMANENT;
  150. $file = file_save($file); //Cache the file.
  151. $record = array(
  152. 'fid' => $fid,
  153. );
  154. return $record;
  155. }
  156.  
  157. /**
  158.  * Implementation of hook_fbsmp_repost_form().
  159.  */
  160. function fbsmp_document_fbsmp_repost_form(&$form_state, $attachment) {
  161. $form = array();
  162. $form['fbsmp_document_repost'] = array(
  163. '#value' => fbsmp_document_fbsmp_themed_attachment($attachment),
  164. );
  165.  
  166. $form['fbsmp_attachment_object'] = array(
  167. '#type' => 'value',
  168. '#value' => $attachment,
  169. );
  170.  
  171. return $form;
  172. }
  173.  
  174. /**
  175.  * Implementation of hook_fbsmp_widget_form_validate().
  176.  */
  177. function fbsmp_document_fbsmp_repost_form_validate(&$form, &$form_state) {
  178. $settings = fbsmp_load_plugin_settings('document');
  179. $dest = _fbsmp_file_create_path($settings['file_path']);
  180. if (!_fbsmp_file_check_directory($dest, FILE_CREATE_DIRECTORY)) {
  181. watchdog('fbsmp', 'The upload directory %directory could not be created or is not accessible. A re-posted document could not be saved in this directory as a consequence.', array('%directory' => $dest));
  182. form_set_error('fbsmp_document_repost', t('The document could not be re-posted.'));
  183. return 0;
  184. }
  185.  
  186. $orig_attachment = $form_state['values']['fbsmp_attachment_object'];
  187. $file = (array)_fbsmp_file_load($orig_attachment->data['fid']);
  188. if (!$file['filepath'] || !$file['fid']) {
  189. form_set_error('fbsmp_document_repost', t('The document could not be re-posted.'));
  190. return 0;
  191. }
  192.  
  193. if ($new_file = _fbsmp_file_save_file($file['filepath'], array(), $dest)) {
  194. $form_state['values']['fbsmp_document_repost'] = $new_file->fid;
  195. }
  196. else {
  197. form_set_error('fbsmp_document_repost', t('The document could not be re-posted.'));
  198. return 0;
  199. }
  200. }
  201.  
  202. /**
  203.  * Implementation of hook_fbsmp_widget_form_submit().
  204.  */
  205. function fbsmp_document_fbsmp_repost_form_save(&$form, &$form_state) {
  206. $fid = $form_state['values']['fbsmp_document_repost'];
  207. //file_set_status(_fbsmp_file_load($fid), FILE_STATUS_PERMANENT); //Cache the file.
  208. $file = _fbsmp_file_load($fid); //Cache the file.
  209. $file->status = FILE_STATUS_PERMANENT;
  210. file_save($file);
  211.  
  212. $record = array(
  213. 'fid' => $fid,
  214. );
  215. return $record;
  216. }
  217.  
  218. /**
  219.  * Themes a document using fielfield generic file theming.
  220.  *
  221.  * @param $attachment
  222.  * The attachment object.
  223.  * @param $settings
  224.  * (optional) An array which can have one or more of following keys:
  225.  *
  226.  * @return
  227.  * Return a themed document, with the specified settings.
  228.  */
  229. function theme_fbsmp_document_attachment_default($variables) {
  230. $attachment = $variables['attachment'];
  231. $settings = $variables['settings'];
  232. $attachment_data = $attachment->data;
  233.  
  234. $file = (array)_fbsmp_file_load($attachment_data['fid']);
  235. if (!is_file($file['uri'])) {
  236. return '<!-- File not found: '. check_plain($file['filename']) .' -->';
  237. }
  238. $attributes = array();
  239.  
  240. if (isset($settings['class']) && $settings['class']) {
  241. $attributes['class'] = $settings['class'];
  242. }
  243.  
  244. $url = file_create_url($file['uri']);
  245. $output = '';
  246. if (0 && function_exists('theme_pdfpreview_formatter') && $file['filemime'] == 'application/pdf'){
  247. $output_filename = _pdfpreview_create_preview($file);
  248.  
  249. $output = "<img src=\"/$output_filename\" title=\"{$file['data']['description']}\" alt=\"{$file['data']['description']}\" />";
  250. if (0 && list($namespace, $presetname) = explode('][', $element['#formatter'], 2)) {
  251. if ($preset = imagecache_preset_by_name($namespace)) {
  252. $output = theme('imagecache', $namespace, $output_filename, $file['data']['alt'], $file['data']['title']);
  253. }
  254. }
  255. $tag = variable_get('pdfpreview_tag', 'span');
  256. $output = "<div class=\"pdfpreview\" id=\"pdfpreview-{$file['fid']}\">
  257. <$tag class=\"image-wrapper\"><a href=\"/".url($file['filepath'])."\" title=\"{$file['data']['description']}\">
  258. $output</a></$tag>$description</div>";
  259. }
  260. if (empty($output))
  261. $output = theme_download_file_formatter_direct_download(array('items' => array($file)));
  262. return $output;
  263. }
  264.  
  265. /**
  266.  * Implementation of hook_fbsmp_themed_attachment().
  267.  */
  268. function fbsmp_document_fbsmp_themed_attachment($attachment) {
  269.  
  270. $settings = fbsmp_load_plugin_settings('document');
  271. //return theme('fbsmp_document_attachment_default', $attachment, $settings);
  272. return theme('fbsmp_document_attachment_default', array('attachment' => $attachment, 'settings' => $settings));
  273.  
  274. }
  275.  
  276. /**
  277.  * Implementation of hook_fbsmp_subtheme().
  278.  */
  279. function fbsmp_document_fbsmp_subtheme() {
  280. return array(
  281. 'fbsmp_document_attachment_default' => array(
  282. 'arguments' => array('attachment' => NULL, 'settings' => NULL),
  283. 'file' => 'plugins/document.inc',
  284. ),
  285. );
  286. }
  287.  
  288. /**
  289.  * Implementation of hook_fbsmp_token_list().
  290.  */
  291. function fbsmp_document_fbsmp_token_list() {
  292. return array(
  293. 'document-id' => t('The fid of the saved document.'),
  294. 'document-url' => t('The URL that can be used to download the document.'),
  295. );
  296. }
  297.  
  298. /**
  299.  * Implementation of hook_fbsmp_token_values().
  300.  */
  301. function fbsmp_document_fbsmp_token_values($attachment) {
  302. $attachment_data = $attachment->data;
  303. $file = (array)_fbsmp_file_load($attachment_data['fid']);
  304. $file_url = '';
  305. if (is_file($file['filepath'])) {
  306. $file_url = file_create_url($file['filepath']);
  307. }
  308. return array(
  309. 'document-id' => $attachment_data['fid'],
  310. 'document-url' => $file_url,
  311. );
  312. }
  313.  
  314. /**
  315.  * Break out for fbsmp_fbsmp_delete().
  316.  */
  317. function fbsmp_document_fbsmp_delete($status) {
  318. $attachment_data = $status->attachment->data;
  319. _fbsmp_file_delete(_fbsmp_file_load($attachment_data['fid']));
  320. }
  321.  
  322. /**
  323.  * Break out for fbsmp_file_download().
  324.  */
  325. function fbsmp_document_file_download($file) {
  326. $file = file_create_path($file);
  327.  
  328. $result = db_query("SELECT * FROM {files} WHERE filepath = '%s'", $file);
  329. if (!$file = db_fetch_object($result)) {
  330. // We don't really care about this file.
  331. return;
  332. }
  333.  
  334. $records = fbsmp_get_attachments('document');
  335. foreach ($records as $record) {
  336. if ($record['data']['fid'] == $file->fid) {
  337. // Check if current user has access to this status.
  338. if (fbsmp_status_can_view(facebook_status_load($record['sid']))) {
  339. // Access is granted.
  340. $name = mime_header_encode($file->filename);
  341. $type = mime_header_encode($file->filemime);
  342. $disposition = 'inline';
  343.  
  344. return array(
  345. 'Content-Type: ' . $type . '; name='. $name,
  346. 'Content-Length: ' . $file->filesize,
  347. 'Content-Disposition: ' . $disposition . '; filename="' . $name . '"',
  348. 'Cache-Control: private',
  349. );
  350. }
  351.  
  352. return -1;
  353. }
  354. }
  355. }
  356.  
  357. /**
  358.  * Get the upload validators for a document upload field.
  359.  *
  360.  * @param $settings
  361.  * The settings array for the plugin.
  362.  * @return
  363.  * An array suitable for passing to file_save_upload() or the file field
  364.  * element's '#upload_validators' property.
  365.  */
  366. function fbsmp_document_widget_upload_validators($settings) {
  367. $max_filesize = parse_size(file_upload_max_size());
  368. if (!empty($settings['max_filesize']) && parse_size($settings['max_filesize']) < $max_filesize) {
  369. $max_filesize = parse_size($settings['max_filesize']);
  370. }
  371.  
  372. $validators = array(
  373. 'file_validate_size' => array($max_filesize),
  374. 'file_validate_extensions' => array($settings['file_extensions']),
  375. );
  376.  
  377. return $validators;
  378. }

Change your fbsmp.plugins.inc (under sites/all/modules/fbsmp/) to look like as below.

</> CopyGet raw version
php
  1. <?php
  2.  
  3. /**
  4.  * @file
  5.  * CTools plugins declarations.
  6.  */
  7.  
  8. /**
  9.  * Break out for fbsmp_fbsmp_plugins().
  10.  */
  11. function _fbsmp_fbsmp_plugins() {
  12. $path = drupal_get_path('module', 'fbsmp') .'/plugins';
  13. $image_path = _fbsmp_get_image_dir() .'/plugins';
  14. $info = array();
  15. $info['link'] = array(
  16. 'name' => t('Link'),
  17. 'file' => 'link.inc',
  18. 'path' => $path,
  19. 'icon' => $image_path .'/images/link.png',
  20. 'description' => t('Lets users publish links with their statuses.'),
  21. 'admin_settings_form' => 'fbsmp_link_fbsmp_admin_settings_form',
  22. 'admin_settings_form_validate' => 'fbsmp_link_fbsmp_admin_settings_form_validate',
  23. 'admin_settings_form_submit' => 'fbsmp_link_fbsmp_admin_settings_form_submit',
  24. 'widget_form' => 'fbsmp_link_fbsmp_widget_form',
  25. 'widget_form_validate' => 'fbsmp_link_fbsmp_widget_form_validate',
  26. 'widget_form_save' => 'fbsmp_link_fbsmp_widget_form_save',
  27. 'subtheme' => 'fbsmp_link_fbsmp_subtheme',
  28. 'themed attachment' => 'fbsmp_link_fbsmp_themed_attachment',
  29. 'token list' => 'fbsmp_link_fbsmp_token_list',
  30. 'token values' => 'fbsmp_link_fbsmp_token_values',
  31. 'repost_form' => 'fbsmp_link_fbsmp_repost_form',
  32. 'repost_form_validate' => 'fbsmp_link_fbsmp_widget_form_validate',
  33. 'repost_form_submit' => 'fbsmp_link_fbsmp_widget_form_save',
  34. 'edit_form' => 'fbsmp_link_fbsmp_edit_form',
  35. 'edit_form_submit' => 'fbsmp_link_fbsmp_edit_form_submit',
  36. 'supported_url_params' => 'fbsmp_link_fbsmp_supported_url_params',
  37. 'url_param_form' => 'fbsmp_link_fbsmp_url_param_form',
  38. 'url_param_form_validate' => 'fbsmp_link_fbsmp_widget_form_validate',
  39. 'url_param_form_submit' => 'fbsmp_link_fbsmp_widget_form_save',
  40. 'exported theme variables' => 'fbsmp_link_fbsmp_token_values',
  41. );
  42. $info['photo'] = array(
  43. 'name' => t('Photo'),
  44. 'file' => 'photo.inc',
  45. 'path' => $path,
  46. 'icon' => $image_path .'/images/photo.png',
  47. 'widget_form' => 'fbsmp_photo_fbsmp_widget_form',
  48. 'widget_form_validate' => 'fbsmp_photo_fbsmp_widget_form_validate',
  49. 'admin_settings_form' => 'fbsmp_photo_fbsmp_admin_settings_form',
  50. 'admin_settings_form_validate' => 'fbsmp_photo_fbsmp_admin_settings_form_validate',
  51. 'admin_settings_form_submit' => 'fbsmp_photo_fbsmp_admin_settings_form_submit',
  52. 'description' => t('Lets users publish images with their statuses.'),
  53. 'subtheme' => 'fbsmp_photo_fbsmp_subtheme',
  54. 'themed attachment' => 'fbsmp_photo_fbsmp_themed_attachment',
  55. 'widget_form_save' => 'fbsmp_photo_fbsmp_widget_form_save',
  56. 'token list' => 'fbsmp_photo_fbsmp_token_list',
  57. 'token values' => 'fbsmp_photo_fbsmp_token_values',
  58. 'repost_form' => 'fbsmp_photo_fbsmp_repost_form',
  59. 'repost_form_validate' => 'fbsmp_photo_fbsmp_repost_form_validate',
  60. 'repost_form_submit' => 'fbsmp_photo_fbsmp_repost_form_save',
  61. 'exported theme variables' => 'fbsmp_photo_fbsmp_token_values',
  62. 'file download' => 'fbsmp_photo_file_download',
  63. );
  64. $info['document'] = array(
  65. 'name' => t('Document'),
  66. 'file' => 'document.inc',
  67. 'path' => $path,
  68. 'icon' => $image_path .'/images/document.png',
  69. 'widget_form' => 'fbsmp_document_fbsmp_widget_form',
  70. 'widget_form_validate' => 'fbsmp_document_fbsmp_widget_form_validate',
  71. 'admin_settings_form' => 'fbsmp_document_fbsmp_admin_settings_form',
  72. 'admin_settings_form_validate' => 'fbsmp_document_fbsmp_admin_settings_form_validate',
  73. 'admin_settings_form_submit' => 'fbsmp_document_fbsmp_admin_settings_form_submit',
  74. 'description' => t('Lets users publish images with their statuses.'),
  75. 'subtheme' => 'fbsmp_document_fbsmp_subtheme',
  76. 'themed attachment' => 'fbsmp_document_fbsmp_themed_attachment',
  77. 'widget_form_save' => 'fbsmp_document_fbsmp_widget_form_save',
  78. 'token list' => 'fbsmp_document_fbsmp_token_list',
  79. 'token values' => 'fbsmp_document_fbsmp_token_values',
  80. 'repost_form' => 'fbsmp_document_fbsmp_repost_form',
  81. 'repost_form_validate' => 'fbsmp_document_fbsmp_repost_form_validate',
  82. 'repost_form_submit' => 'fbsmp_document_fbsmp_repost_form_save',
  83. 'exported theme variables' => 'fbsmp_document_fbsmp_token_values',
  84. 'file download' => 'fbsmp_document_file_download',
  85. );
  86. $info['video'] = array(
  87. 'name' => t('Video'),
  88. 'file' => 'video.inc',
  89. 'path' => $path,
  90. 'icon' => $image_path .'/images/video.png',
  91. 'widget_form' => 'fbsmp_video_fbsmp_widget_form',
  92. 'widget_form_validate' => 'fbsmp_video_fbsmp_widget_form_validate',
  93. 'admin_settings_form' => 'fbsmp_video_fbsmp_admin_settings_form',
  94. 'admin_settings_form_validate' => 'fbsmp_video_fbsmp_admin_settings_form_validate',
  95. 'admin_settings_form_submit' => 'fbsmp_video_fbsmp_admin_settings_form_submit',
  96. 'description' => t('Lets users publish videos with their statuses.'),
  97. 'subtheme' => 'fbsmp_video_fbsmp_subtheme',
  98. 'themed attachment' => 'fbsmp_video_fbsmp_themed_attachment',
  99. 'widget_form_save' => 'fbsmp_video_fbsmp_widget_form_save',
  100. 'token list' => 'fbsmp_video_fbsmp_token_list',
  101. 'token values' => 'fbsmp_video_fbsmp_token_values',
  102. 'exported theme variables' => 'fbsmp_video_fbsmp_token_values',
  103. );
  104. $info['slideshare'] = array(
  105. 'name' => t('Slideshare Document'),
  106. 'file' => 'slideshare.inc',
  107. 'path' => $path,
  108. 'icon' => $image_path .'/images/document.png',
  109. 'widget_form' => 'fbsmp_slideshare_fbsmp_widget_form',
  110. 'widget_form_validate' => 'fbsmp_slideshare_fbsmp_widget_form_validate',
  111. 'admin_settings_form' => 'fbsmp_slideshare_fbsmp_admin_settings_form',
  112. 'admin_settings_form_validate' => 'fbsmp_slideshare_fbsmp_admin_settings_form_validate',
  113. 'admin_settings_form_submit' => 'fbsmp_slideshare_fbsmp_admin_settings_form_submit',
  114. 'description' => t('Lets users publish documents (ppt, doc, etc) with their statuses via SlideShare.'),
  115. 'subtheme' => 'fbsmp_slideshare_fbsmp_subtheme',
  116. 'themed attachment' => 'fbsmp_slideshare_fbsmp_themed_attachment',
  117. 'widget_form_save' => 'fbsmp_slideshare_fbsmp_widget_form_save',
  118. 'token list' => 'fbsmp_slideshare_fbsmp_token_list',
  119. 'token values' => 'fbsmp_slideshare_fbsmp_token_values',
  120. 'exported theme variables' => 'fbsmp_slideshare_fbsmp_token_values',
  121. );
  122. return $info;
  123. }

Comments

Steve's picture

I have been struggling with this code for a while now...always getting an error "Theme hook fbsmp_document_attachment_default not found." and the documents don't show up in the status.

Any help at all would be greatly appreciated.

ooops's picture

Hi Steve
sorry for thee late reply, but I am not able to reproduce this on my end.

ooops's picture

@Steve, a late note:
as mentioned you need to have download_file module as dependency to make it work!