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

renderBreadcrumbs()

Description

Renders a full breadcrumbs trail.

Parameters

ColumnTypeDefaultDescription
$links array List of link "objects" that create the trail
$pre_links string '' Pre-rendered links in HTML form
$class string '' Extra classes for the main container div

Return

void

Location

include/render_functions.php lines 2701 to 2764

Definition

 
function renderBreadcrumbs(array $links$pre_links ''$class '')
    {
    global 
$lang;
    
/*
    NOTE: implemented as seen on themes and search. There is a lot of room for improvement UI wise

    TODO: search_title_processing.php is using it intensively and at the moment there are differences in terms of 
    rendered HTML between themes/ search and search_title_processing.php. We should refactor all places were breadcrumbs
    are being created and make sure they all use this function (or any future related functions - like generateBreadcrumb() ).
    */

    
if(=== count($links))
        {
        return;
        }
    
?>
    <div class="BreadcrumbsBox  echo $class?>">
        <div class="SearchBreadcrumbs">
        
        
if('' !== $pre_links && $pre_links !== strip_tags($pre_links))
            {
            echo 
$pre_links '&nbsp;' LINK_CHEVRON_RIGHT;
            }

        for(
$i 0$i count($links); $i++)
            {
            
$anchor = isset($links[$i]['href']);
            
$anchor_attrs = (isset($links[$i]["attrs"]) && is_array($links[$i]["attrs"]) && !empty($links[$i]["attrs"]) ? $links[$i]["attrs"] : array());
            
$anchor_attrs join(" "$anchor_attrs);

            
// search_title_processing.php is building spans with different class names. We need to allow HTML in link titles.
            
$title get_inner_html_from_tag(strip_tags_and_attributes($links[$i]['title']), "p");

            if(
$i)
                {
                echo 
LINK_CHEVRON_RIGHT;
                }
                
            if (
$anchor) { ?>
                <a href=" echo escape($links[$i]['href']); ?>"
                     if (isset($links[$i]["menu"]) && $links[$i]["menu"]) { ?>
                        onclick="ModalClose(); return ModalLoad(this, true, true, 'right');"
                     } else { ?>
                        onclick="return CentralSpaceLoad(this, true);"
                     }
                    echo 
escape($anchor_attrs); ?>>
             ?>

            <span> echo $title?></span>

             if ($anchor) { ?>
                </a>
             }

            if (isset(
$links[$i]['help']))
                {
                
render_help_link($links[$i]['help']);
                }
            }
            
?>
        </div>
    </div>
    
    
}

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 14:05 Europe/London time.