Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 3780 to 3798

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 19th March 2024 11:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.