function custompage_edit_link in Custom Page 7
Same name and namespace in other branches
- 6 custompage_util.inc \custompage_edit_link()
Generate an Edit link for inline editing.
Parameters
$url: The url to link out to. This is the edit url for the resource you are displaying
$return: Do you want to include the standard 'destination' query string param to return to after edit.
4 calls to custompage_edit_link()
- custompage_menu_tile in ./
custompage_util.inc - custompage_node_tile in ./
custompage_util.inc - custompage_region_tile in ./
custompage_util.inc - Put a regions content in a custompage tile.
- custompage_view_tile in ./
custompage_util.inc - Render a custompage tile for a view.
File
- ./
custompage_util.inc, line 165
Code
function custompage_edit_link($url, $return = TRUE) {
if ($return) {
$dest = substr($_SERVER['REQUEST_URI'], 1);
//chop-out the leading "/"
if (strpos('?', $url) === FALSE) {
$url .= '?';
}
$url .= "destination={$dest}";
}
$editlink = l(t('Edit'), $url);
$editlink = urldecode($editlink);
//urldecode destination argument
return $editlink;
}