function linkit_linkit_attributes in Linkit 7.2
Implements hook_linkit_attributes().
Define them like form elements.
File
- ./
linkit.module, line 696 - Main file for linkit module.
Code
function linkit_linkit_attributes($profile) {
$attributes['accesskey'] = array(
'#type' => 'textfield',
'#title' => 'accesskey',
);
$attributes['class'] = array(
'#type' => 'textfield',
'#title' => 'class',
);
$attributes['id'] = array(
'#type' => 'textfield',
'#title' => 'id',
);
$attributes['rel'] = array(
'#type' => 'textfield',
'#title' => 'rel',
);
$attributes['title'] = array(
'#type' => 'textfield',
'#title' => 'title',
);
foreach ($attributes as $key => &$attribute) {
$attribute += array(
'#maxlength' => 255,
'#size' => 40,
'#default_value' => '',
'#weight' => isset($profile->data['attributes'][$key]['weight']) ? $profile->data['attributes'][$key]['weight'] : 0,
);
}
return $attributes;
}