You are here

class space_setting_color in Spaces 6.2

Provides a color pallette for each space.

Hierarchy

Expanded class hierarchy of space_setting_color

1 string reference to 'space_setting_color'
spaces_design_spaces_settings in spaces_design/spaces_design.module
Implementation of hook_spaces_settings().

File

spaces_design/spaces_design.spaces.inc, line 86

View source
class space_setting_color implements space_setting {
  var $id;
  function __construct($id = NULL) {
    $this->id = 'color';
  }
  function form($space, $value = array()) {
    $form = array(
      '#theme' => 'spaces_design_colorpicker',
      '#title' => t('Colors'),
      '#description' => t('Enter an RGB hexidecimal value like <strong>#ffffff</strong>. Leave blank to use the default colors for this space.'),
      '#type' => 'textfield',
      '#size' => '7',
      '#maxlength' => '7',
      '#default_value' => $value ? $value : '#',
    );
    return $form;
  }
  function validate($space, $value) {
    return $value;
  }
  function submit($space, $value) {

    // Clear out values if the color is invalid
    if (!_spaces_design_validate_color($value)) {
      $value = '';
    }
    return $value;
  }

}

Members