Windows/Tab Titles now reflect the current page your on along with the company name or selected client. Pages contact details, asset details, tickets, projects, documents, invoices, quotes, recurring invoices overide to include more detail in tab title

This commit is contained in:
johnnyq
2025-01-13 14:40:05 -05:00
parent 0cb3cdc26d
commit 97723da633
16 changed files with 75 additions and 58 deletions

32
includes/page_title.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
// Set Page Title
// Get the current page name without the .php extension
$page_title = basename($_SERVER['PHP_SELF'], '.php');
// Remove 'client_' from the page name
$page_title = str_replace('client_', '', $page_title);
// Remove 'report_' from the page name
$page_title = str_replace('report_', '', $page_title);
// Remove 'admin_' from the page name
$page_title = str_replace('admin_', '', $page_title);
// Remove 'admin_' from the page name
$page_title = str_replace('settings_', '', $page_title);
// Replace any underscores with spaces
$page_title = str_replace('_', ' ', $page_title);
// Capitize
$page_title = ucwords($page_title);
// Sanitize title for SQL input such as logging
$page_title_sanitized = sanitizeInput($page_title);
// Sanitize the page title to prevent XSS for output
$page_title = nullable_htmlentities($page_title);
$tab_title = $session_company_name;