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

render_access_key_tr()

Description

Render a table row (tr) for a single access key

Parameters

ColumnTypeDefaultDescription
$record array Access key record details

Return

void

Location

include/render_functions.php lines 1712 to 1774

Definition

 
function render_access_key_tr(array $record)
    {
    global 
$baseurl$baseurl_short$lang;
    
$link      '';
    
$type      '';
    
$edit_link '';

    
// Set variable dependent on type (ie. Resource / Collection)
    
if('' == $record['collection'] && '' != $record['resource'])
        {
        
// For resource
        
$link      $baseurl '?r=' urlencode($record['resource']) . '&k=' urlencode($record['access_key']);
        
$type      $lang['share-resource'];
        
$edit_link sprintf('%spages/resource_share.php?ref=%s&editaccess=%s&editexpiration=%s&editaccesslevel=%s&editgroup=%s&backurl=%s',
            
$baseurl_short,
            
urlencode($record['resource']),
            
urlencode($record['access_key']),
            
urlencode($record['expires']),
            
urlencode($record['access']),
            
urlencode($record['usergroup']),
            
urlencode("/pages/team/team_external_shares.php")
        );
        }
    else
        {
        
// For collection
        
$link      $baseurl '?c=' urlencode($record['collection']) . '&k=' urlencode($record['access_key']);
        
$type      $lang['sharecollection'];
        
$edit_link sprintf('%spages/collection_share.php?ref=%s&editaccess=%s&editexpiration=%s&editaccesslevel=%s&editgroup=%s&backurl=%s',
            
$baseurl_short,
            
urlencode($record['collection']),
            
urlencode($record['access_key']),
            
urlencode($record['expires']),
            
urlencode($record['access']),
            
urlencode($record['usergroup']),
            
urlencode("/pages/team/team_external_shares.php")
        );
        }
        
?>


    <tr id="access_key_ echo $record['access_key']; ?>">
        <td>
            <div class="ListTitle">
                <a href=" echo $link?>" target="_blank"> echo escape($record['access_key']); ?></a>
            </div>
        </td>
        <td> echo escape($type); ?></td>
        <td> echo escape(resolve_users($record['users'])); ?></td>
        <td> echo escape($record['emails']); ?></td>
        <td> echo escape(nicedate($record['maxdate'], truetruetrue)); ?></td>
        <td> echo escape(nicedate($record['lastused'], truetruetrue)); ?></td>
        <td> echo escape(('' == $record['expires']) ? $lang['never'] : nicedate($record['expires'], false)); ?></td>
        <td> echo escape((-== $record['access']) ? '' $lang['access' $record['access']]); ?></td>
        <td>
            <div class="ListTools">
                <a href="#" onClick="delete_access_key(' echo $record['access_key']; ?>', ' echo $record['resource']; ?>', ' echo $record['collection']; ?>');"> echo LINK_CARET ?> echo escape($lang['action-delete']); ?></a>
                <a href=" echo $edit_link?>"> echo LINK_CARET ?> echo escape($lang['action-edit']); ?></a>
            </div>
        </td>
    </tr>
    
    
}

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.