Changeset 3956:93073017d895 for admin
- Timestamp:
- 01/28/19 15:59:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/media.php
r3933 r3956 281 281 }; 282 282 283 $forgetDir = function($d) { 284 // Remove a directory from recent and fav list (if necessary) 285 global $core; 286 287 $core->auth->user_prefs->addWorkspace('interface'); 288 $nb_last_dirs = (integer) ($core->auth->user_prefs->interface->media_nb_last_dirs); 289 if ($nb_last_dirs > 0) { 290 // Remove from recent dirs 291 $last_dirs = $core->auth->user_prefs->interface->media_last_dirs; 292 if (is_array($last_dirs)) { 293 if (in_array($d, $last_dirs)) { 294 unset($last_dirs[array_search($d, $last_dirs)]); 295 $core->auth->user_prefs->interface->put('media_last_dirs', $last_dirs, 'array'); 296 } 297 } 298 // Remove from fav dirs 299 $fav_dirs = $core->auth->user_prefs->interface->media_fav_dirs; 300 if (is_array($fav_dirs)) { 301 if (in_array($d, $fav_dirs)) { 302 unset($fav_dirs[array_search($d, $fav_dirs)]); 303 $core->auth->user_prefs->interface->put('media_fav_dirs', $fav_dirs, 'array'); 304 } 305 } 306 } 307 }; 308 283 309 // Actions 284 310 … … 454 480 if ($dir && !empty($_POST['rmyes']) && !empty($_POST['remove'])) { 455 481 $_POST['remove'] = rawurldecode($_POST['remove']); 482 $forget = false; 456 483 457 484 try { 458 485 if (is_dir(path::real($core->media->getPwd() . '/' . path::clean($_POST['remove'])))) { 459 486 $msg = __('Directory has been successfully removed.'); 487 # Remove dir from recents/favs if necessary 488 $forget = true; 460 489 } else { 461 490 $msg = __('File has been successfully removed.'); 462 491 } 463 492 $core->media->removeItem($_POST['remove']); 493 if ($forget) { 494 $forgetDir($d . '/' . path::clean($_POST['remove'])); 495 } 464 496 dcPage::addSuccessNotice($msg); 465 497 $core->adminurl->redirect('admin.media', $page_url_params);
Note: See TracChangeset
for help on using the changeset viewer.