Commit 21ba2a4b authored by targoo's avatar targoo

removed unused drupal 7 code

parent b927e194
......@@ -19,30 +19,6 @@ function color_field_help($path, $arg) {
}
}
/**
* Implements hook_field_info().
*/
function color_field_field_info() {
$types['color_field'] = array(
'label' => t('Color Field'),
'description' => t('Field using a hexadecimal notation.'),
'instance_settings' => array(
'alfa' => TRUE,
),
'default_widget' => 'color_field_default',
'default_formatter' => 'color_field_hex',
'field item class' => '\Drupal\color_field\Type\ColorFieldItem',
);
return $types;
}
/**
* Implements hook_field_is_empty().
*/
function color_field_field_is_empty($item, $field) {
return !isset($item['rgb']) || $item['rgb'] === '';
}
/**
* Implements hook_field_instance_settings_form().
*/
......@@ -58,60 +34,6 @@ function color_field_field_instance_settings_form($field, $instance) {
return $form;
}
/**
* Implements hook_field_load().
*/
/*function color_field_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
foreach ($entities as $id => $entity) {
foreach ($items[$id] as $delta => &$item) {
// Unserialize the attributes into an array. The value stored in the
// field data should either be NULL or a non-empty serialized array.
if (empty($item['attributes'])) {
$item['attributes'] = array();
}
else {
$item['attributes'] = unserialize($item['attributes']);
}
}
}
}*/
/**
* Implements hook_field_presave().
*/
/*function color_field_field_presave(EntityInterface $entity, $field, $instance, $langcode, &$items) {
foreach ($items as $delta => &$item) {
// Trim any spaces around the rgb.
$item['rgb'] = trim($item['rgb']);
//$item['title'] = trim($item['title']);
}
}*/
/**
* Implements hook_theme().
*/
/*function color_field_theme() {
return array(
'color_field_formatter_color_field_separate' => array(
'variables' => array('title' => NULL, 'url_title' => NULL, 'href' => NULL, 'options' => array()),
),
);
}*/
/**
* Formats a link as separate title and URL elements.
*/
/*function theme_color_field_formatter_color_field_separate($vars) {
$output = '';
$output .= '<div class="link-item">';
if (!empty($vars['title'])) {
$output .= '<div class="link-title">' . check_plain($vars['title']) . '</div>';
}
$output .= '<div class="link-url">' . l($vars['url_title'], $vars['href'], $vars['options']) . '</div>';
$output .= '</div>';
return $output;
}*/
/**
* Helper: Convert RGB to HEX6
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment