Collections functions
General functions
Render functions
Theme permission functions
User 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: string { # 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;

Location

include/collections_functions.php lines 3474 to 3488

Definition

 
function remove_from_collection_link($resource,$search="",$class=""string $onclick ''$basketmode false): string
    
{
    
# 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 6th June 2023 11:05 Europe/London time based on the source file dated 5th June 2023 14:35 Europe/London time.