<?php
  
/**
* @file 
* Provides a description field for attribute options.
* @author Jake Roufa <jacob.roufa@gmail.com/>
* @link http://jacobroufa.com
*/

// @todo
// AJAX (or AHAH) loading of description when option is selected from drop-down during the purchase item customization process


/* -----------------------------------------------------------------

  Hook Implementations 

------------------------------------------------------------------ */  

/**
 * Implementation of hook_perm();
 */
function uc_option_desc_perm(){
  return array('view option description');
}

/**
* Implementation of hook_form_alter();
*/
function uc_option_desc_form_alter(&$form, &$form_state, $form_id){ 
  switch($form_id){
    // Attribute options form
    case 'uc_attribute_option_form':
	    $form['description'] = array(
		  '#type' => 'textarea',
		  '#title' => t('Description'),
		  '#description' => t('This description will appear during the product customization process of checkout.'),
		  '#default_value' => ($attribute->description),
		  '#required' => TRUE,
		  '#weight' => 2,
		);
	break;
  }
}