Collections functions
General functions
Render functions
Theme permission functions
Resource 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 192 to 205

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 26th September 2022 12:35 Europe/London time based on the source file dated 30th June 2022 11:10 Europe/London time.