Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name = List City Module
- description = List the scrapyard cities
- core = 7.x
- <?php
- /**
- * Implements hook_block_info().
- */
- function listcitymodule_block_info() {
- $blocks = array();
- $blocks['listcitymodule'] = array(
- 'info' => t('My Custom Block'),
- );
- return $blocks;
- }
- /**
- * Implements hook_block_configure().
- */
- function listcitymodule_block_configure($delta='') {
- $form = array();
- switch($delta) {
- case 'listcitymodule' :
- // Text field form element
- $form['text_body'] = array(
- '#type' => 'text_format',
- '#title' => t('Enter your text here in WYSIWYG format'),
- '#default_value' => variable_get('text_variable', ''),
- );
- // File selection form element
- $form['file'] = array(
- '#name' => 'block_image',
- '#type' => 'managed_file',
- '#title' => t('Choose an Image File'),
- '#description' => t('Select an Image for the custom block. Only *.gif, *.png, *.jpg, and *.jpeg images allowed.'),
- '#default_value' => variable_get('block_image_fid', ''),
- '#upload_location' => 'public://block_image/',
- '#upload_validators' => array(
- 'file_validate_extensions' => array('gif png jpg jpeg'),
- ),
- );
- break;
- }
- return $form;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment