Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

is_field_displayed()

Description

Checks whether a specified field should be displayed based on various conditions.

This function evaluates several criteria to determine if a field is visible in the resource editing interface.
It takes into account the field's active status, permissions for viewing and editing, upload conditions,
and any custom hooks that may hide the field.

Parameters

ColumnTypeDefaultDescription
$field array The field configuration array containing information about the field's settings.

Return

bool Returns true if the field should be displayed; false otherwise.

Location

include/render_functions.php lines 1786 to 1802

Definition

 
function is_field_displayed($field)
    {
    global 
$ref$resource$upload_review_mode;

    
# Conditions under which the field is not displayed
    
return !(
        (
$field['active']==0)
        
# Field does not have individual write access allowed; and does not have edit access allowed on upload
        
|| (checkperm("F*") && !checkperm("F-" $field["ref"]) && !($ref && checkperm("P" $field["ref"])))
        
# Field has write access denied directly
        
|| checkperm("F" $field["ref"])
        
# Field is hidden on upload
        
|| (($ref || $upload_review_mode) && $field["hide_when_uploading"])
        
# Other field conditions
        
|| hook('edithidefield''', array('field' => $field))
        || 
hook('edithidefield2''', array('field' => $field)));
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 3rd December 2024 11:55 Europe/London time.