File manager: style fixes#2079
Conversation
WalkthroughThe changes update the copyright years from 2023 to 2025 across several PHP, JavaScript, and CSS files. The diffs introduce formatting improvements by adding spaces around operators, parameters, and in function calls, along with inserting blank lines to improve readability. A single CSS rule affecting the table row hover background has been removed. Additionally, the error handling in the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (11)
emhttp/plugins/dynamix/include/Control.php (3)
24-27: Improved Function Separation
A blank line (or adjusted spacing) has been inserted before themy_age()function declaration. This subtle formatting improvement improves readability without impacting functionality.
36-39: Consistent Formatting invalidnameFunction
Thevalidname()function now uses consistent spacing and line breaks. This change enhances code clarity while preserving its original behavior.
41-42: Uniform Formatting for Helper Functions
The one-line definitions forescape()andquoted()have been reformatted for consistency. This improves readability without altering any functional logic.emhttp/plugins/dynamix/include/Browse.php (1)
25-132: Consistent Function Formatting and Spacing
Multiple functions in this file (includingvaliddir(),escapeQuote(),add(),age(),my_age(),parent_link(),my_devs(), andicon_class()) have been reformatted with consistent spacing and blank lines. These style fixes improve readability and maintainability without changing functionality.emhttp/plugins/dynamix/nchan/file_manager (3)
24-25: Uniform Plugin Configuration Extraction
The callextract(parse_plugin_cfg('dynamix', true));has been reformatted (or repositioned) to fit the style guide. This change is purely stylistic and does not affect execution.
27-29: Consistent Translation Loading Setup
The insertion of$login_locale = $display['locale'] ?? '';after setting
$_SERVER['REQUEST_URI']brings consistency to the translation-loading block. This improvement enhances clarity without altering functionality.
31-44: Improved Function Declaration Formatting
Functions such aspool_only(),pools_filter(), anddelete_file()now include well-defined spacing and blank lines. These non‐functional style changes support better readability and maintenance.emhttp/plugins/dynamix/BrowseButton.page (4)
19-24: Consistent Array Formatting
The$dfmarray now uses uniform spacing around keys and values. This improves readability and maintains consistency with the rest of the code base.
47-66: Enhanceddfm_footerFunction Formatting
Thedfm_footer()function’s case structure and spacing have been refined. These changes improve visual clarity and make the function easier to read, while the underlying logic remains intact.
293-294: Improved Dialog Initialization Flow
Minor spacing adjustments indfm_openDialog()help improve code clarity when fetching dynamic data and constructing the dialog. The change is purely stylistic.
1-357: General Style and Readability Improvements
Overall, this file has received extensive style fixes—including spacing adjustments, consistent formatting of function definitions, and updated dialog options. These modifications enhance the readability and maintainability of the code without changing any of the underlying functionality.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
emhttp/plugins/dynamix/Browse.page(43 hunks)emhttp/plugins/dynamix/BrowseButton.page(15 hunks)emhttp/plugins/dynamix/include/Browse.php(6 hunks)emhttp/plugins/dynamix/include/Control.php(3 hunks)emhttp/plugins/dynamix/include/Templates.php(1 hunks)emhttp/plugins/dynamix/nchan/file_manager(7 hunks)emhttp/plugins/dynamix/sheets/Browse.css(0 hunks)
💤 Files with no reviewable changes (1)
- emhttp/plugins/dynamix/sheets/Browse.css
🧰 Additional context used
🧬 Code Definitions (1)
emhttp/plugins/dynamix/include/Browse.php (1)
emhttp/plugins/dynamix/include/Control.php (1) (1)
age(21-23)
🔇 Additional comments (46)
emhttp/plugins/dynamix/include/Templates.php (1)
2-3: Updated Copyright Notice
The copyright notice has been updated to use “2025” for both Lime Technology and Bergware International. This is a straightforward, non‐functional text change that aligns with similar updates across the code base.emhttp/plugins/dynamix/include/Control.php (1)
2-3: Updated Copyright Notice
The header now reflects the new year range (“2005-2025” and “2012-2025”). This update is non‐functional and ensures consistency with other files.emhttp/plugins/dynamix/include/Browse.php (1)
1-3: Updated Copyright Notice
The copyright annotations now use “2025” instead of “2023”. This update is cosmetic and does not affect any program logic.emhttp/plugins/dynamix/nchan/file_manager (1)
3-4: Updated Copyright Notice
The header comments now reflect the updated year range (“2005-2025” and “2012-2025”) for copyright. This is a cosmetic update applied consistently across the codebase.emhttp/plugins/dynamix/BrowseButton.page (2)
7-9: Updated Copyright Notice
The copyright header has been modified to reflect the updated years (“2025”) for both Lime Technology and Bergware International. This is a non‐functional, style-only change.
258-260: Dialog Class Assignment Update
The dialog configuration has been updated from usingdialogClass: 'ui-dfm'to the modern approach:classes: {'ui-dialog': 'ui-dfm'}This change ensures better compatibility with current jQuery UI standards and enhances style management without affecting functionality.
emhttp/plugins/dynamix/Browse.page (40)
6-7: Copyright Years Updated Consistently
The header now reflects the updated years (2005-2025 for Lime Technology and 2012-2025 for Bergware International), which aligns with the overall update.
21-23: Improved Array-to-String Conversion Formatting
Thedfm_arrayfunction now neatly usesimplodewitharray_mapand clear spacing, increasing readability without changing functionality.
26-29: Enhanced Readability in Directory Validation
Thevaliddirfunction’s return statement now formats thein_arraycheck (with the null-coalescing operator) in a clearer, concise manner.
30-34: Refined Directory Sanitization and Assignment
The updates to the directory sanitization (usinghtmlspecialchars_decode,my_explode, andstr_replace) and the conditional assignment for$locknow follow a uniform style, which improves overall clarity.
38-38: Consistent Initialization for Editor Configuration
The one-line check that usesfile_existsandfile_put_contentswith an array of file types has been reformatted for clarity.
47-47: Clean Embedding of PHP Variable into JavaScript
The assignment ofdirusing PHP shorthand (<?=$dir?>) is maintained with improved spacing.
52-56: Clearer Formatting inautoscaleFunction
The calculations inautoscale(unit array, logarithmic computation, and conditional check) now feature improved spacing and structure, which aids in readability while preserving the computation logic.
59-70: Uniform Style infolderContextMenuFunction
The function signature and the setup of context menu options (including PHP conditionals) have been reformatted, yielding a cleaner and more consistent code style.
88-92: Consistent Formatting infileContextMenuFunction
The revised formatting of this function improves the clarity of the menu options without altering the intended behavior.
115-120: Neat Presentation indeviceFolderContextMenu
The formatting changes in the device folder context menu function ensure that option definitions are clearly indented and easy to follow.
145-148: StreamlinedhomeFunction Structure
Thehomefunction now exhibits improved formatting for its initialization and AJAX call (via$.ajax), which enhances the readability of its synchronous result retrieval.
157-159: SimplifiedresizeFunction
The slight formatting adjustments in theresizefunction make it immediately clear how the element height is determined relative to the window size.
196-200: Improved Input State Handling inselectOne
The changes in theselectOnefunction—especially the concise update of the disabled state for.extraand.renameinputs—result in a more understandable and consistent UI state update.
211-213: Refined Error Alert inerrorTarget
The inline callback that re-enables the target field now has improved formatting, which clarifies the error handling process.
217-221: Conditional Return Formatting indataFunction
The use of the PHP conditional block combined with a ternary return statement has been tidied up to clearly differentiate between share and non-share cases.
251-260: Enhanced Dialog Configuration infileEdit
The configuration of the file editor dialog—especially the clear assignment of dialog classes, dimensions, and button actions—now features more readable spacing and structure.
291-300: Consistent Dialog Setup indoJobs(Part 1)
The initialization of the jobs dialog, including class settings and the AJAX call in the Start button, now follows uniform spacing conventions that elevate code readability.
317-324: Improved Cleanup Logic indoJobs(Part 2)
The conditional block that handles the deletion response—cleaning cookies and updating the UI—is now more legible with consistent indentation and spacing.
338-339: Clear Timeout Handling in File Monitor Event
The message event callback for the file monitor now clearly checks the running state and schedules a refresh with proper formatting, ensuring smooth asynchronous behavior.
342-343: Streamlined Start ofdoActionFunction
The function signature and the initial variable assignment (e.g. determining if the ID represents a link) have been reformatted for a more intuitive reading experience.
367-367: Uniform Use of PHP Short Tag indoAction
The assignment of thehdlinkvariable using the PHP short tag syntax is now clearly presented, without affecting functionality.
495-496: Consistent Conditional Check for Moving Operations
The condition callinghome(source,target)to decide whether to increment the action parameter is now uniformly formatted. This improves the clarity of decision points in the move folder/file actions.
565-566: Uniformity in Conditional Logic for Queue Actions
The repeated check usingif (home(source,target) == 1) action++;inside the queue handling preserves consistency and enhances readability across similar action cases.
604-605: Clear Dialog Cancel Logic indoAction
The adjustments following the dialog setup (ensuring disabled button states are applied when necessary) now appear with improved spacing, which helps clarify the control flow immediately after dialog creation.
608-609: Crisp Initialization indoActionsFunction
The very start ofdoActionsnow cleanly declares variables and sets up preliminary conditions, aiding overall code legibility.
632-633: ConsistenthdlinkAssignment indoActions
The assignment of thehdlinkvariable is now synchronized with its usage elsewhere, reinforcing consistency across similar components.
691-695: Refined Callback Formatting in File Tree Attachment
WithindoActions, the callback for attaching the file tree now clearly defines variable usage (such as the auto-appended share segment) with better spacing for enhanced understanding.
741-742: Robust Fallback for Source indoActions
The logic that filters and defaults the source if empty is now written more succinctly, mitigating potential edge case issues.
749-756: Uniform Dialog Configuration indoActions
The dialog initialization block insidedoActionsis now uniformly structured, with explicit definitions for classes, dimensions, and modal behavior, ensuring consistency with other dialog windows.
815-819: Clear Disabling of Permission Fields
The conditional block that disables the owner, group, and other fields when action 12 is in effect now appears clearly indented, improving maintainability.
887-888: Improved Button State Update indoActions
The final close-button handling and dialog focus adjustments have been reformatted for clarity, ensuring that UI focus is set appropriately after dialog creation.
891-893: Neat Cleanup instopUploadFunction
ThestopUploadfunction’s logic for resetting the uploader state (cancelling pending uploads, re-enabling buttons, and cookie management) is now easier to follow with improved spacing.
911-919: Chunked File Uploads with Clear Logic inuploadFile
TheuploadFilefunction now clearly slices the file into 2 MB chunks and proceeds with base64 encoding. The structured flow through error checking and progress reporting is much improved by the formatting changes.
920-922: Precise Response Handling in File Uploads
The checks for reply values of'stop'and'error'in the upload callback are now clearly distinguished, ensuring that upload interruptions are handled gracefully.
941-943: Consolidated Initialization for Upload Process
Declaring thereaderandcancelvariables together makes the initialization for the file upload process more coherent.
945-949: Improved Guard and Setup instartUpload
ThestartUploadfunction now first checks for empty file input and then properly sets up the FileReader, onbeforeunload, and button state. These changes enhance safety and user feedback during uploads.
955-957: Concise Filtering infilterFunction
Thefilterfunction’s use of a jQuery each loop with a clear condition (hiding or showing rows based on the file type match) has been neatly formatted.
963-965: Tidy Toggle intoggleTimeFunction
ThetoggleTimefunction’s cookie check and toggle logic now appear more succinct, which enhances its readability.
987-997: Refined Document Ready Initialization
The jQuery ready block now builds dynamic breadcrumbs and sets up table references with improved clarity. The inline HTML generation has also been spaced for better maintainability.
1018-1022: Clean HTML Markup for File Manager Interface
The markup within the<div class="autoheight">section (including table headers) has been tidied for clarity and consistency with the style improvements seen across the file.
|
ccs styling in file manager was broken due to update to latest version of jQuery-UI |
Summary by CodeRabbit
Chores
Style
Bug Fixes
get_nvme_infofunction to prevent potential errors from accessing non-existent array elements.