<?php

function ChatFB_help($path, $arg) {
  switch ($path) {
    case 'admin/help#ChatFB':
      return '<p>' . t('Configuracion modulo ChatFB', array('storage' => 'Configuracion modulo ChatFB' )) . '</p>';
  }
}

function ChatFB_permission() {
  return array(
    'administer ChatFB' =>  array(
      'title' => t('Administer ChatFB'),
      'description' => t('Perform administration ChatFB'),
    ),
  );
}

function ChatFB_block_info() {
  $blocks['chat_fb'] = array(
    'info' => t('Chat'),
    'cache' => DRUPAL_NO_CACHE
  );
  return $blocks;
}

function ChatFB_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'chat_fb':
      $block['content'] = variable_get('ChatFB_block_text','');
      break;  
  }
  return $block;
}

function ChatFB_block_configure($delta = '') {
$iframe=variable_get('ChatFB_block_text','');
  $form = array();
  switch ($delta) {
    case 'chat_fb':
    $form['ChatFB_block_text']=array(
      '#type' => 'textarea',
      '#title' => t('Iframe Chat Facebook:'),
      '#default_value' => variable_get('ChatFB_block_text',$iframe),
    );
       break;
  }
  return $form;
}
  
function ChatFB_block_save($delta = '', $edit = array()) {
  switch ($delta) {
    case 'chat_fb':
      variable_set('ChatFB_block_text', $edit['ChatFB_block_text']);
      break;
  }
}