Changeset 2512:446ce952707d
- Timestamp:
- 11/05/13 09:50:09 (10 years ago)
- Branch:
- 2.6
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_media.js
r2346 r2512 11 11 button.prop('disabled',true).addClass('disabled'); 12 12 } 13 13 14 14 function displayMessageInQueue(n) { 15 15 var msg = ''; … … 24 24 $('.queue-message',me).html(msg); 25 25 } 26 26 27 27 $('.button.choose_files').click(function(e) { 28 28 // Use the native click() of the file input. … … 30 30 e.preventDefault(); 31 31 }); 32 32 33 33 $('.button.cancel', '#fileupload .fileupload-buttonbar').click(function(e) { 34 34 $('.button.cancel','#fileupload .fileupload-buttonbar').hide(); … … 36 36 displayMessageInQueue(0); 37 37 }); 38 38 39 39 $(me).on('click','.cancel',function(e) { 40 40 if ($('.fileupload-ctrl .files .template-upload', me).length==0) { … … 44 44 displayMessageInQueue($('.files .template-upload',me).length); 45 45 }); 46 46 47 47 $('.button.clean', me).click(function(e) { 48 48 $('.fileupload-ctrl .files .template-download', me).slideUp(500, function() { … … 52 52 e.preventDefault(); 53 53 }); 54 54 55 55 $(me).fileupload({ 56 56 url: $(me).attr('action'), … … 79 79 } 80 80 }); 81 81 82 82 var $container = $(me).parent(); 83 83 var $msg,label; … … 100 100 $('#upfile').attr('multiple', false); 101 101 enableButton($('.button.start','#fileupload .fileupload-buttonbar')); 102 102 103 103 // when a user has clicked enhanced_uploader, and has added files 104 104 // We must remove files in table … … 120 120 $(this).find('a').text($msg); 121 121 $('.add-label', me).text(label); 122 122 123 123 $container.toggleClass('enhanced_uploader'); 124 124 e.preventDefault(); … … 172 172 $('body').on('click','a.media-remove',function() { 173 173 var m_name = $(this).parents('.media-item').find('a.media-link').text(); 174 if (window.confirm(dotclear.msg.confirm_delete_media.replace('%s',m_name))) { 174 var m_text=''; 175 if ($(this).parents('div.media-folder').length == 0) { 176 m_text = dotclear.msg.confirm_delete_media.replace('%s',m_name); 177 } else { 178 m_text = dotclear.msg.confirm_delete_directory.replace('%s',m_name); 179 } 180 if (window.confirm(m_text)) { 175 181 var f = $('#media-remove-hide').get(0); 176 182 f.elements['remove'].value = this.href.replace(/^(.*)&remove=(.*?)(&|$)/,'$2'); -
admin/media.php
r2430 r2512 111 111 $zip->addExclusion('#(^|/).(.*?)_(m|s|sq|t).jpg$#'); 112 112 $zip->addDirectory($core->media->root.'/'.$d,'',true); 113 113 114 114 header('Content-Disposition: attachment;filename='.($d ? $d : 'media').'.zip'); 115 115 header('Content-Type: application/x-zip'); … … 210 210 { 211 211 $_POST['remove'] = rawurldecode($_POST['remove']); 212 212 213 213 try { 214 if (is_dir(path::real($core->media->getPwd().'/'.path::clean($_POST['remove'])))) { 215 $msg = __('Directory has been successfully removed.'); 216 } else { 217 $msg = __('File has been successfully removed.'); 218 } 214 219 $core->media->removeItem($_POST['remove']); 215 216 dcPage::addSuccessNotice(__('File has been successfully removed.')); 220 dcPage::addSuccessNotice($msg); 217 221 http::redirect($page_url.'&d='.rawurlencode($d)); 218 222 } catch (Exception $e) { … … 250 254 ) 251 255 ); 252 256 253 257 echo 254 258 '<form action="'.html::escapeURL($page_url).'" method="post">'. … … 261 265 form::hidden('remove',html::escapeHTML($_GET['remove'])).'</p>'. 262 266 '</form>'; 263 267 264 268 call_user_func($close_f); 265 269 exit; … … 372 376 if (count($items) == 0) 373 377 { 374 echo 378 echo 375 379 '<p>'.__('No file.').'</p>'. 376 380 sprintf($fmt_form_media,'',' hide'); // need for jsUpload to append new media … … 379 383 { 380 384 $pager = new dcPager($page,count($items),$nb_per_page,10); 381 385 382 386 echo 383 387 '<form action="media.php" method="get" id="filters-form">'. … … 403 407 } 404 408 } 405 406 echo 409 410 echo 407 411 ($dgroup != '' ? '<div class="folders-group">'.$dgroup.'</div>' : ''). 408 412 sprintf($fmt_form_media,$fgroup,''); 409 413 410 414 echo $pager->getLinks(); 411 415 } … … 420 424 echo 421 425 '<div class="vertical-separator">'. 422 '<h3 class="out-of-screen-if-js">'.sprintf(__('In %s:'),($d == '' ? '“'.__('Media manager').'”' : '“'.$d.'”')).'</h3>'; 423 } 424 425 $core_media_archivable = $core->auth->check('media_admin',$core->blog->id) && 426 '<h3 class="out-of-screen-if-js">'.sprintf(__('In %s:'),($d == '' ? '“'.__('Media manager').'”' : '“'.$d.'”')).'</h3>'; 427 } 428 429 $core_media_archivable = $core->auth->check('media_admin',$core->blog->id) && 426 430 !(count($items) == 0 || (count($items) == 1 && $items[0]->parent)); 427 431 428 432 if ($core_media_writable || $core_media_archivable) { 429 echo 433 echo 430 434 '<div class="two-boxes odd">'; 431 435 … … 457 461 } 458 462 459 echo 463 echo 460 464 '</div>'; 461 465 } … … 464 468 { 465 469 echo 466 '<div class="two-boxes fieldset even">'; 470 '<div class="two-boxes fieldset even">'; 467 471 if ($user_ui_enhanceduploader) { 468 472 echo … … 527 531 528 532 if ($core_media_writable || $core_media_archivable) { 529 echo 533 echo 530 534 '</div>'; 531 535 } … … 542 546 { 543 547 global $core, $page_url, $popup, $post_id; 544 548 545 549 $fname = $f->basename; 546 550 547 551 $class = 'media-item media-col-'.($i%2); 548 552 549 553 if ($f->d) { 550 554 $link = html::escapeURL($page_url).'&d='.html::sanitizeURL($f->relname); … … 559 563 'media_item.php?id='.$f->media_id.'&popup='.$popup.'&post_id='.$post_id; 560 564 } 561 565 562 566 $maxchars = 36; 563 567 if (strlen($fname) > $maxchars) { … … 569 573 570 574 $lst = ''; 571 575 572 576 if (!$f->d) { 573 577 $lst .= … … 579 583 '</li>'; 580 584 } 581 585 582 586 $act = ''; 583 587 584 588 if ($post_id && !$f->d) { 585 $act .= 589 $act .= 586 590 '<a class="attach-media" title="'.__('Attach this file to entry').'" href="post_media.php?media_id='.$f->media_id. 587 591 '&post_id='.$post_id.'&attach=1">'. … … 589 593 '</a>'; 590 594 } 591 595 592 596 if ($popup && !$f->d) { 593 597 $act .= '<a href="'.$link.'"><img src="images/plus.png" alt="'.__('Insert this file into entry').'" '. 594 598 'title="'.__('Insert this file into entry').'" /></a> '; 595 599 } 596 600 597 601 if ($f->del) { 598 602 if (!$popup && !$f->d) { … … 605 609 } 606 610 } 607 611 608 612 $lst .= ($act != '' ? '<li class="media-action"> '.$act.'</li>' : ''); 609 613 610 614 if ($f->type == 'audio/mpeg3') { 611 615 $lst .= '<li>'.dcMedia::mp3player($f->file_url,'index.php?pf=player_mp3.swf').'</li>'; 612 616 } 613 617 614 618 $res .= ($lst != '' ? '<ul>'.$lst.'</ul>' : ''); 615 619 616 620 $res .= '</div>'; 617 621 618 622 return $res; 619 623 } -
inc/admin/lib.dc.page.php
r2508 r2512 656 656 self::jsVar('dotclear.msg.confirm_delete_media', 657 657 __('Are you sure you want to remove media "%s"?')). 658 self::jsVar('dotclear.msg.confirm_delete_directory', 659 __('Are you sure you want to remove directory "%s"?')). 658 660 self::jsVar('dotclear.msg.confirm_extract_current', 659 661 __('Are you sure you want to extract archive in current directory?')). -
locales/_pot/main.pot
r2509 r2512 3530 3530 msgstr "" 3531 3531 3532 #: inc/admin/lib.dc.page.php:657 3533 #, php-format 3534 msgid "Are you sure you want to remove directory \"%s\"?" 3535 msgstr "" 3536 3532 3537 #: inc/admin/lib.dc.page.php:659 3533 3538 msgid "Are you sure you want to extract archive in current directory?" -
locales/fr/main.po
r2509 r2512 2581 2581 2582 2582 #, php-format 2583 msgid "Are you sure you want to remove directory \"%s\"?" 2584 msgstr "Êtes-vous certain de vouloir supprimer le répertoire \"%s\" ?" 2585 2586 #, php-format 2583 2587 msgid "Are you sure you want to remove media \"%s\"?" 2584 2588 msgstr "Êtes-vous certain de vouloir supprimer le média \"%s\" ?"
Note: See TracChangeset
for help on using the changeset viewer.