Collections functions
General functions
Render functions
Theme permission functions
Resource functions

remove_from_collection_link()

Description

Render a "remove from collection" link wherever such a function is shown in the UI

Parameters

ColumnTypeDefaultDescription
$resource integer
$search string ""
$class string ""
$onclick string '' Additional onclick code to call before returning false.
$basketmode false

Return

void

Location

include/collections_functions.php lines 3184 to 3198

Definition

 
function remove_from_collection_link($resource,$search="",$class=""string $onclick ''$basketmode false)
    {
    
# Generates a HTML link for removing a resource from a collection
    # The collection is referred to as the basket when in basket mode
    
global $lang$pagename;

    if (
$basketmode
        {
        return 
"<a class=\"removeFromCollection " $class "\" href=\"#\" title=\"" $lang["removefrombasket"] . "\" onClick=\"RemoveResourceFromCollection(event,'" $resource "','" $pagename "');{$onclick} return false;\" data-resource-ref=\"{$resource}\">";
        }
    else 
        {
        return 
"<a class=\"removeFromCollection " $class "\" href=\"#\" title=\"" $lang["removefromcurrentcollection"] . "\" onClick=\"RemoveResourceFromCollection(event,'" $resource "','" $pagename "');{$onclick} return false;\" data-resource-ref=\"{$resource}\">";
        }
    }

This article was last updated 20th May 2022 08:35 Europe/London time based on the source file dated 17th May 2022 15:20 Europe/London time.