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

save_tab()

Description

Update an existing tab.
NOTE: order_by should only be set when re-ordering the set by the user. {@see sql_reorder_records('tab', $refs)}

Parameters

ColumnTypeDefaultDescription
$tab array A tab record (type)

Return

bool Returns TRUE if it executed the query, FALSE otherwise

Location

include/tab_functions.php lines 188 to 201

Definition

 
function save_tab(array $tab)
    {
    
$ref = (int) $tab['ref'];
    
$name trim($tab['name']);
    
    if(
$ref && $name !== '' && acl_can_manage_tabs())
        {
        
log_activity(nullLOG_CODE_EDITED$name'tab''name'$ref);
        
ps_query('UPDATE tab SET `name` = ? WHERE ref = ?', ['s'$name'i'$ref]);
        return 
true;
        }

    return 
false;
    }

This article was last updated 15th December 2024 08:05 Europe/London time based on the source file dated 16th May 2024 18:10 Europe/London time.