Guest User

Untitled

a guest
Nov 13th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. name = List City Module
  2. description = List the scrapyard cities
  3. core = 7.x
  4.  
  5. <?php
  6.  
  7. /**
  8. * Implements hook_block_info().
  9. */
  10. function listcitymodule_block_info() {
  11. $blocks = array();
  12. $blocks['listcitymodule'] = array(
  13. 'info' => t('My Custom Block'),
  14. );
  15.  
  16. return $blocks;
  17. }
  18.  
  19. /**
  20. * Implements hook_block_configure().
  21. */
  22. function listcitymodule_block_configure($delta='') {
  23. $form = array();
  24.  
  25. switch($delta) {
  26. case 'listcitymodule' :
  27. // Text field form element
  28. $form['text_body'] = array(
  29. '#type' => 'text_format',
  30. '#title' => t('Enter your text here in WYSIWYG format'),
  31. '#default_value' => variable_get('text_variable', ''),
  32. );
  33.  
  34. // File selection form element
  35. $form['file'] = array(
  36. '#name' => 'block_image',
  37. '#type' => 'managed_file',
  38. '#title' => t('Choose an Image File'),
  39. '#description' => t('Select an Image for the custom block. Only *.gif, *.png, *.jpg, and *.jpeg images allowed.'),
  40. '#default_value' => variable_get('block_image_fid', ''),
  41. '#upload_location' => 'public://block_image/',
  42. '#upload_validators' => array(
  43. 'file_validate_extensions' => array('gif png jpg jpeg'),
  44. ),
  45. );
  46. break;
  47. }
  48. return $form;
  49. }
  50.  
  51.  
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment