You are here

fbss_custom.module in Drupal Commons 6.2

Customizations of FBSS.

File

modules/features/commons_status_streams/fbss_custom/fbss_custom.module
View source
<?php

/**
 * @file
 *   Customizations of FBSS.
 */

/**
 * Implementation of hook_form_FORM_ID_alter().
 */
function fbss_custom_form_facebook_status_box_alter(&$form, $form_state) {

  // Add js for showing the buttons on form focus
  drupal_add_js(drupal_get_path('module', 'fbss_custom') . '/fbss_custom.js');
  $form['fbsmp']['link_icon']['#attributes']['style'] = "background-image: url('" . base_path() . $form['fbsmp']['link_icon']['#src'] . "');";
  unset($form['fbsmp']['link_icon']['#src']);
  $form['fbsmp']['link_icon']['#type'] = 'submit';
  $form['fbsmp']['link_icon']['#value'] = 'Link';
  $form['fbsmp']['link_icon']['#attributes']['class'] = $form['fbsmp']['link_icon']['#attributes']['class'] . ' button';
  $form['fbsmp']['photo_icon']['#attributes']['style'] = "background-image: url('" . base_path() . $form['fbsmp']['photo_icon']['#src'] . "');";
  unset($form['fbsmp']['photo_icon']['#src']);
  $form['fbsmp']['photo_icon']['#type'] = 'submit';
  $form['fbsmp']['photo_icon']['#value'] = 'Photo';
  $form['fbsmp']['photo_icon']['#attributes']['class'] = $form['fbsmp']['photo_icon']['#attributes']['class'] . ' button';

  // Remove the tool tips provided by FBSMP since Commons uses button text
  // rather than images, making the tool tips redundant.
  foreach (fbsmp_get_plugins() as $key => $info) {
    $name = $info['name'] ? $info['name'] : $key;
    if (!empty($form['fbsmp'][$key . '_icon']['#suffix'])) {
      $form['fbsmp'][$key . '_icon']['#suffix'] = '</div>';
    }
  }
}

Functions