mirror of
https://github.com/itflow-org/itflow
synced 2026-08-16 20:45:12 +00:00
Rename Functions: flash_alert, sanitizeFilename and display_folder_options using camelCase instead to match other custom php functions
This commit is contained in:
@@ -169,7 +169,7 @@ function getFieldById($table, $id, $field, $escape_method = 'sql') {
|
||||
}
|
||||
|
||||
// Recursive function to display folder options - Used in folders files and documents
|
||||
function display_folder_options($parent_folder_id, $client_id, $indent = 0) {
|
||||
function displayFolderOptions($parent_folder_id, $client_id, $indent = 0) {
|
||||
global $mysqli;
|
||||
|
||||
$sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_client_id = $client_id ORDER BY folder_name ASC");
|
||||
@@ -190,7 +190,7 @@ function display_folder_options($parent_folder_id, $client_id, $indent = 0) {
|
||||
echo "<option value=\"$folder_id\" $selected>$indentation$folder_name</option>";
|
||||
|
||||
// Recursively display subfolders
|
||||
display_folder_options($folder_id, $client_id, $indent + 1);
|
||||
displayFolderOptions($folder_id, $client_id, $indent + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ function enforceClientAccess($client_id = null) {
|
||||
$session_user_id = (int) $session_user_id;
|
||||
|
||||
if (empty($client_id) || empty($session_user_id)) {
|
||||
flash_alert('Access Denied.', 'error');
|
||||
flashAlert('Access Denied.', 'error');
|
||||
redirect('clients.php');
|
||||
}
|
||||
|
||||
@@ -116,6 +116,6 @@ function enforceClientAccess($client_id = null) {
|
||||
$client_id
|
||||
);
|
||||
|
||||
flash_alert('Access Denied - You do not have permission to access that client!', 'error');
|
||||
flashAlert('Access Denied - You do not have permission to access that client!', 'error');
|
||||
redirect('clients.php');
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ function redirect($url = null, $permanent = false) {
|
||||
}
|
||||
|
||||
//Flash Alert Function
|
||||
function flash_alert(string $message, string $type = 'success'): void {
|
||||
function flashAlert(string $message, string $type = 'success'): void {
|
||||
$_SESSION['alert_type'] = $type;
|
||||
$_SESSION['alert_message'] = $message;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ function sanitize_url($url) {
|
||||
}
|
||||
|
||||
// Sanitize File Names
|
||||
function sanitize_filename($filename, $strict = false) {
|
||||
function sanitizeFilename($filename, $strict = false) {
|
||||
// Remove path information and dots around the filename
|
||||
$filename = basename($filename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user