Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 191 to 204

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 19th March 2024 09:35 Europe/London time based on the source file dated 18th August 2023 11:35 Europe/London time.