Skip to content

Commit d2a399d

Browse files
committed
Added option to hide folder in media
1 parent fa4efea commit d2a399d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Controllers/MediaController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function folders($slug = 'media', $path = null, $id = null, $depth
4747
if (!$response) {
4848
$response .= '<ul' . (config('admin.modules.' . $slug . '.expanded') > 0 && config('admin.modules.' . $slug . '.expanded') <= $depth ? ' class="closed"' : '') . '>';
4949
}
50-
$response .= '<li data-id="' . urlencode($id . basename($directory)) . '">';
50+
$response .= '<li class="' . (in_array($id . basename($directory), config('admin.modules.' . $slug . '.hidden') ?? []) ? 'hidden' : '') . '" data-id="' . urlencode($id . basename($directory)) . '">';
5151
$response .= MediaController::folderRow($directory);
5252
$response .= MediaController::folders($slug, $directory, $id . basename($directory) . '/', $depth + 1);
5353
$response .= '</li>';

src/config.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@
220220
'expanded' => 3, # Open folders upto this depth (default all)
221221
'maxUploadSize' => '12', # Maximum size of an uploaded file in megabytes, still limited by php.ini upload_max_filesize and post_max_size
222222
'folder' => 'media', # Base folder to store uploaded files. Will be public_path(this)
223+
'hidden' => [ # Hide certain folders
224+
'resized',
225+
]
226+
223227
],
224228
'reports' => [
225229
'view' => 'admin::reports',

src/css/base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ nav li:hover > ul > li {max-height:40px}
100100
#listview .content {position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;overflow-y:auto}
101101
#listview UL {display:block;margin:0;padding:0;white-space:nowrap}
102102
#listview LI {display:block;margin:0;padding:0;cursor:pointer}
103+
#listview LI.hidden {display:none}
103104
#listview LI > DIV {margin:0 -4px 0 0;padding:6px 7px 7px;border-bottom:1px solid rgba(0,0,0,0.05);border-top:1px solid rgba(255,255,255,0.35);background-color:#eee;position:relative;height:20px;transition:height .25s,padding .25s,opacity .25s}
104105
#listview LI > DIV > SPAN {display:inline-block;color:rgba(0,0,0,0.4);font-size:0.85em;font-weight:400;margin:0 6px}
105106
#listview LI > DIV > SPAN:first-of-type {font-weight:400;color:#000;font-size:1em}

0 commit comments

Comments
 (0)