Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

is_collection_approved()

Description

Return an array of distinct archive/workflow states for resources in $collection

Parameters

ColumnTypeDefaultDescription
$collection integer

Return

array

Location

include/collections_functions.php lines 2863 to 2881

Definition

 
function is_collection_approved($collection)
        {
        if (
is_array($collection)){$result=$collection;}
        else
            {
            
$result=do_search("!collection" $collection,"","relevance",0,-1,"desc",false,"",false,"");
            }    
        if (!
is_array($result) || count($result)==0){return true;}
        
        
$collectionstates=array();
        global 
$collection_allow_not_approved_share;
        for (
$n=0;$n<count($result);$n++)
            {
            
$archivestatus=$result[$n]["archive"];
            if (
$archivestatus<&& !$collection_allow_not_approved_share) {return false;}
            
$collectionstates[]=$archivestatus;
            }
        return 
array_unique($collectionstates);
        }

This article was last updated 23rd November 2020 16:05 Europe/London time based on the source file dated 23rd November 2020 16:00 Europe/London time.