function _follow_links_form_link in Follow 7
Same name and namespace in other branches
- 5 follow.module \_follow_links_form_link()
- 6 follow.module \_follow_links_form_link()
- 7.2 follow.module \_follow_links_form_link()
Helper function to create an individual link form element.
1 call to _follow_links_form_link()
- follow_links_form in ./
follow.module - The form for editing follow links.
File
- ./
follow.module, line 469 - Allows users to add links to their social network profiles.
Code
function _follow_links_form_link($link, $title, $uid) {
$elements = array();
$elements['name'] = array(
'#markup' => $title,
);
if (isset($link->lid)) {
$elements['lid'] = array(
'#type' => 'hidden',
'#value' => $link->lid,
);
$elements['weight'] = array(
'#type' => 'weight',
'#default_value' => $link->weight,
);
}
$elements['url'] = array(
'#type' => 'textfield',
'#follow_network' => $link->name,
'#follow_uid' => $uid,
'#default_value' => isset($link->url) ? $link->url : '',
'#element_validate' => array(
'follow_url_validate',
),
'#maxlength' => 255,
);
// Provide the title of the link only if the link URL is there and the user
// has the appropriate access.
$elements['title'] = array(
'#type' => 'textfield',
'#default_value' => isset($link->title) ? $link->title : '',
'#size' => 15,
'#access' => user_access('change follow link titles') && !empty($link->url),
);
return $elements;
}