Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View dirSize instead of word "Folder" #184

Closed
EV-soft opened this issue Jun 7, 2019 · 1 comment
Closed

View dirSize instead of word "Folder" #184

EV-soft opened this issue Jun 7, 2019 · 1 comment
Labels

Comments

@EV-soft
Copy link

EV-soft commented Jun 7, 2019

I have some suggestions for improvement:

tinyfilemanager.php version 2.3.6:

A: Show dirsize & align-right: ---------------
Change line:
1709    <td><?php echo lng('Folder') ?></td>
to:
1709    <td style="text-align:right;" title= "<?php $inf= dirSize($path . '/' . $f); echo 'Total: '.$inf[1].' ',lng('Files'); ?>"> <?php echo fm_get_filesize($inf[0]) ?></td> 

and:
1758    <td><span title="<?php printf('%s bytes', $filesize_raw) ?>"><?php echo $filesize ?></span></td>
to:
1758    <td style="text-align:right;"><span title="<?php printf('%s bytes', $filesize_raw) ?>"><?php echo $filesize ?></span></td>

and add near file end:
function dirSize($directory) {
    $size = 0;  $count= 0;
    foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file)
    if ($file->isFile())  // Added EV-soft
    {
        $size+=$file->getSize();
        $count++;
    }
    return [$size,$count];
}


B: Adding custom icon in navbar ---------------
Add before:
2811    <a class="navbar-brand" href=""> <?php echo lng('AppTitle') ?> </a>
so:
2811    <?php echo $cust_icon ?>  
2812    <a class="navbar-brand" href=""> <?php echo lng('AppTitle') ?> </a>
        

after:
72      $root_path = $_SERVER['DOCUMENT_ROOT'];
add new:
++:     // Insert custom text/icon in navbar before AppTitle:
++:     $cust_icon = '<img src= "'.substr($root_path,0,strpos($root_path,'_assets'))'/saldi-e/_assets/images/saldi-e50x170.png " alt="SALDI-€" height="20" style="top:-1px; position:absolute;" >';  //  Example

C: And here are a danish translation: ---------------
   {
     "name": "Dansk",
     "code": "da",
     "translation": {
       "AppName": "Tiny File Manager",
       "AppTitle": "Fil Manager",
       "Login": "Log ind",
       "Username": "Brugernavn",
       "Password": "Password",
       "Logout": "Log ud",
       "Move": "Flyt",
       "Copy": "Kopier",
       "Save": "Gem",
       "SelectAll": "Vælg alle",
       "UnSelectAll": "Fravælg alle",
       "File": "Fil",
       "Back": "Tilbage",
       "Size": "Størrelse",
       "Perms": "Tilladelser",
       "Modified": "Ændret",
       "Owner": "Ejer",
       "Search": "Søg filnavn",
       "NewItem": "Nyt Element",
       "Folder": "Mappe",
       "Delete": "Slet",
       "Rename": "Omdøb",
       "CopyTo": "Kopier til",
       "DirectLink": "Direkte link",
       "UploadingFiles": "Oploader filer",
       "ChangePermissions": "Ændre tilladelser",
       "Copying": "Kopierer",
       "CreateNewItem": "Opret nyt emne",
       "Name": "Navn",
       "AdvancedEditor": "Avanceret Editor",
       "RememberMe": "Husk mig",
       "Actions": "Handling",
       "Upload": "Opload",
       "Cancel": "Afbryd",
       "InvertSelection": "Omvend valg",
       "DestinationFolder": "Mål mappe",
       "ItemType": "Filtype",
       "ItemName": "Filnavn",
       "CreateNow": "Opret nu",
       "Download": "Download",
       "Open": "Åben",
       "UnZip": "Udpak",
       "UnZipToFolder": "Udpak i mappe",
       "Edit": "Rediger",
       "NormalEditor": "Standard Editor",
       "BackUp": "Backup",
       "SourceFolder": "Kilde mappe",
       "Files": "Filer",
       "Change": "Ændre",
       "Settings": "Indstillinger",
       "Language": "Sprog"
     }
   },

```

Remark:
I think the key "Search" should display: "File search", because it not works, when i am in the Advanced editor
prasathmani pushed a commit that referenced this issue Jul 23, 2019
view file is insecure #187
Get files size (recursive) #186
There is no possibility for translation for some hints (title =) #185
View dirSize instead of word "Folder" #184
Document type detection #183
Stored Cross-site Scripting (XSS) Vulnerability detected in File Names #180
strings in code #177
Remove tracking #164
@prasathmani
Copy link
Owner

added folder size, thanks for sharing code @EV-soft

ner00 pushed a commit to ner00/tinyfilemanager that referenced this issue May 7, 2023
view file is insecure prasathmani#187
Get files size (recursive) prasathmani#186
There is no possibility for translation for some hints (title =) prasathmani#185
View dirSize instead of word "Folder" prasathmani#184
Document type detection prasathmani#183
Stored Cross-site Scripting (XSS) Vulnerability detected in File Names prasathmani#180
strings in code prasathmani#177
Remove tracking prasathmani#164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants