<?php


 /**
  * Implements hook_block_info().
  */
 function instagram_block_info() {

   $blocks['feeds'] = array(
     'info' => t('Feeds Instagram'),
     'cache' => DRUPAL_NO_CACHE
   );  
   return $blocks;
 }

 /**
  * Implements hook_block_view().
  */
 function instagram_block_view($delta = '') {
   $block = array();
    switch ($delta) {
     case 'feeds':
      $block['content'] =  theme('instagram_template');
    break;
   }
   return $block;
 }

/**
 * Implementation of hook_block_configure().
 */
function instagram_block_configure($delta = ''){
  $form = array();
  switch ($delta) {
    case 'feeds':
      $form['fieldset']['token'] = array(
        '#type' => 'textfield', 
        '#title' => t('Token'), 
        '#size' => 250, 
        '#maxlength' => 60, 
        '#default_value' => variable_get('token', NULL),
        '#description' => t('Example elfsight-app-00beabe2-f8e2-48fd-924c-c452109'),
      );
    break;
  }
  return $form;
}

/**
 * Implementation of hook_block_save().
 */
function instagram_block_save($delta = '', $edit = array()){
  switch ($delta) {
    case 'feeds':
      if (isset($edit['token'])) {
        variable_set('token', $edit['token']);
      }
    break;
  }
}