Dotclear

Changeset 548


Ignore:
Timestamp:
11/06/08 21:59:28 (15 years ago)
Author:
Moe
google:author:
appears
Message:

DL Manager 1.0-RC3 :

  • fixed Javascript warning
  • added pagination for files
  • added index.php file for plugin configuration
  • added new icons for video and audio files
  • replaced <tpl:DLMHeader> by <tpl:LoopPosition start="1" length="1">
  • replaced <tpl:DLMFooter> by <tpl:LoopPosition start="-1">
  • replaced <tpl:DLMDownloadCounter> by <tpl:DLMIfDownloadCounter>
  • changed files paths
  • removed duplicate code in media_player.html
  • removed <tpl:DLMBreadCrumbSeparator>
Location:
plugins/dlManager
Files:
6 added
1 deleted
9 edited
4 moved

Legend:

Unmodified
Added
Removed
  • plugins/dlManager/_admin.php

    r544 r548  
    2222# ***** END LICENSE BLOCK ***** 
    2323 
    24 if (!defined('DC_RC_PATH')) {return;} 
     24if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2525 
    26 $core->addBehavior('adminBeforeBlogSettingsUpdate', 
    27      array('dlManagerAdmin','adminBeforeBlogSettingsUpdate')); 
    28 $core->addBehavior('adminBlogPreferencesForm', 
    29      array('dlManagerAdmin','adminBlogPreferencesForm')); 
     26$_menu['Plugins']->addItem(__('Download Manager'), 
     27     'plugin.php?p=dlManager', 
     28     'index.php?pf=dlManager/icon.png', 
     29     preg_match('/plugin.php\?p=dlManager(&.*)?$/',$_SERVER['REQUEST_URI']), 
     30     $core->auth->check('admin',$core->blog->id)); 
    3031 
    3132$core->addBehavior('initWidgets',array('dlManagerAdmin','initWidgets')); 
     
    3738class dlManagerAdmin 
    3839{ 
    39      /** 
    40      adminBeforeBlogSettingsUpdate behavior 
    41      @param    settings  <b>object</b>  Settings 
    42      */ 
    43      public static function adminBeforeBlogSettingsUpdate(&$settings) 
    44      { 
    45           global $core; 
    46  
    47           $settings->setNameSpace('dlmanager'); 
    48           $settings->put('dlmanager_active',!empty($_POST['dlmanager_active']), 
    49                'boolean','Enable DL Manager'); 
    50           $settings->put('dlmanager_counter',!empty($_POST['dlmanager_counter']), 
    51                'boolean','Enable download counter'); 
    52           $settings->put('dlmanager_attachment_url',!empty($_POST['dlmanager_attachment_url']), 
    53                'boolean','Redirect attachments links to DL Manager'); 
    54           $settings->put('dlmanager_enable_sort',!empty($_POST['dlmanager_enable_sort']), 
    55                'boolean','Allow visitors to choose how to sort files'); 
    56           $settings->put('dlmanager_file_sort', 
    57                (!empty($_POST['dlmanager_file_sort']) ? $_POST['dlmanager_file_sort'] : ''), 
    58                'string','file sort'); 
    59           $settings->put('dlmanager_root', 
    60                (!empty($_POST['dlmanager_root']) ? $_POST['dlmanager_root'] : ''), 
    61                'string', 'root directory'); 
    62           # inspirated from lightbox/admin.php 
    63           $settings->setNameSpace('system'); 
    64      } 
    65  
    66      /** 
    67      adminBlogPreferencesForm behavior 
    68      @param    core <b>object</b>  Core 
    69      @return   <b>string</b> XHTML 
    70      */ 
    71      public static function adminBlogPreferencesForm(&$core) 
    72      { 
    73           echo '<fieldset>'. 
    74           '<legend>'.__('Download manager').'</legend>'. 
    75           '<p>'. 
    76           form::checkbox('dlmanager_active',1, 
    77                $core->blog->settings->dlmanager_active). 
    78           '<label class="classic" for="dlmanager_active">'. 
    79           sprintf(__('Enable the %s'),__('Download manager')). 
    80           '</label>'. 
    81           '</p>'. 
    82           '<p class="form-note">'. 
    83           sprintf(__('The %s display media on a public page.'), 
    84                __('Download manager')). 
    85           '</p>'. 
    86           '<p>'. 
    87           form::checkbox('dlmanager_counter',1, 
    88                $core->blog->settings->dlmanager_counter). 
    89           '<label class="classic" for="dlmanager_counter">'. 
    90           __('Enable the download counter'). 
    91           '</label>'. 
    92           '</p>'. 
    93           '<p>'. 
    94           form::checkbox('dlmanager_attachment_url',1, 
    95                $core->blog->settings->dlmanager_attachment_url). 
    96           '<label class="classic" for="dlmanager_attachment_url">'. 
    97           sprintf(__('Redirect attachments links to %s'), 
    98           __('Download manager')). 
    99           '</label>'. 
    100           '</p>'. 
    101           '<p class="form-note">'. 
    102           __('When downloading an attachment, the download counter will be increased.').' '. 
    103           sprintf(__('This will redefine the %s tag.'), 
    104                '<strong>{{tpl:AttachmentURL}}</strong>'). 
    105           '</p>'. 
    106           '<p>'. 
    107           form::checkbox('dlmanager_enable_sort',1, 
    108                     $core->blog->settings->dlmanager_enable_sort). 
    109           '<label class="classic" for="dlmanager_enable_sort">'. 
    110           __('Allow visitors to choose how to sort files'). 
    111           '</label> '. 
    112           '</p>'. 
    113           '<p>'. 
    114           '<label for="dlmanager_file_sort">'. 
    115           __('Sort files:'). 
    116           form::combo('dlmanager_file_sort',dlManager::getSortValues(true), 
    117                $core->blog->settings->dlmanager_file_sort). 
    118           '</label> '. 
    119           '</p>'. 
    120           '<p class="form-note">'. 
    121           __('Leave empty to cancel this feature.'). 
    122           '</p>'. 
    123           '<p>'. 
    124           '<label for="dlmanager_root">'. 
    125           sprintf(__('Change root of %s:'),__('Download manager')). 
    126           form::combo('dlmanager_root',dlManager::listDirs(), 
    127                $core->blog->settings->dlmanager_root). 
    128           '</label> '. 
    129           '</p>'. 
    130           '<p class="form-note">'. 
    131           __('Leave empty to cancel this feature.').' '. 
    132           sprintf(__('This will change the root of the %s page and of the widget.'), 
    133           __('Download manager')).' '. 
    134           sprintf(__('If you change this setting, reconfigure the %s widget.'), 
    135           __('Download manager')). 
    136           '</p>'. 
    137           # filemanager->$exclude_list is protected 
    138           '<p>'. 
    139                sprintf( 
    140                __('Files can be excluded from %1$s by editing <strong>%2$s</strong> in <strong>%3$s</strong>.'), 
    141                __('Download manager'),'media_exclusion',__('about:config')).' '. 
    142                sprintf(__('For example, to exclude %1$s and %2$s files : <code>%3$s</code>'), 
    143                __('PNG'),__('JPG'),'/\.(png|jpg)/i'). 
    144           '</p>'. 
    145           '<p>'. 
    146           sprintf(__('URL of the %s page :'),__('Download manager')). 
    147           '<br />'. 
    148           '<code>'.dlManager::pageURL().'</code>'. 
    149           '<br />'. 
    150           '<a href="'.dlManager::pageURL().'">'.sprintf(__('View the %s page'), 
    151                __('Download manager')).'</a>'.     
    152           '</p>'. 
    153           '</fieldset>'; 
    154      } 
    155  
    15640     /** 
    15741     widget 
  • plugins/dlManager/_define.php

    r547 r548  
    2222# ***** END LICENSE BLOCK ***** 
    2323 
    24 if (!defined('DC_RC_PATH')) { return; } 
     24if (!defined('DC_RC_PATH')) {return;} 
    2525 
    2626$this->registerModule( 
     
    2828     /* Description*/                "Download manager with a public page and a widget", 
    2929     /* Author */                    "Moe (http://gniark.net/), Osku and Tomtom (http://blog.zenstyle.fr)", 
    30      /* Version */                   '1.0-RC2', 
     30     /* Version */                   '1.0-RC3', 
    3131     /* Permissions */               'admin' 
    3232); 
  • plugins/dlManager/_public.php

    r547 r548  
    2222# ***** END LICENSE BLOCK ***** 
    2323 
    24 if (!defined('DC_RC_PATH')) { return; } 
     24if (!defined('DC_RC_PATH')) {return;} 
    2525 
    2626/** 
     
    132132                    } 
    133133               } 
    134  
    135                foreach ($core->media->dir['files'] as $k => $v) 
    136                { 
    137                     $item =& $core->media->dir['files'][$k]; 
    138  
    139                     $item->relname = 
    140                          substr($item->relname,$page_root_len); 
    141                } 
     134                
     135               $_ctx->dlManager_dirs = $core->media->dir['dirs']; 
     136                
     137               $files_array = $core->media->dir['files']; 
     138                
     139               $_ctx->dlManager_pager = new pager( 
     140                    # page 
     141                    ((isset($_GET['page'])) ? $_GET['page'] : 1),count($files_array), 
     142                    $core->blog->settings->dlmanager_nb_per_page,10); 
     143                
     144               $_ctx->dlManager_pager->html_prev = '&#171; '.__('previous page'); 
     145               $_ctx->dlManager_pager->html_next = __('next page').' &#187;'; 
     146                               
     147               $core->media->dir['files'] = array(); 
     148                
     149               for ($i=$_ctx->dlManager_pager->index_start, $j=0; 
     150                    $i<=$_ctx->dlManager_pager->index_end; $i++, $j++) 
     151               { 
     152                    $item =& $files_array[$i]; 
     153 
     154                    $item->relname = substr($item->relname,$page_root_len); 
     155                     
     156                    $core->media->dir['files'][] = $files_array[$i]; 
     157               } 
     158               $_ctx->dlManager_files = $core->media->dir['files']; 
     159                
     160               # download counter 
     161               $_ctx->dlManager_count_dl = 
     162                    unserialize($core->blog->settings->dlmanager_count_dl); 
     163               if (!is_array($_ctx->dlManager_count_dl)) 
     164               { 
     165                    $_ctx->dlManager_count_dl = array(); 
     166               } 
     167                
     168               unset($files_array); 
    142169          } 
    143170          catch (Exception $e) 
     
    174201          } 
    175202           
    176           $_ctx->dlManager_item = $file; 
     203          $_ctx->items = $file; 
    177204          $_ctx->file_url = $file->file_url; 
    178205                
     
    188215          if (!dlManager::inJail($file->relname)) {self::p404();} 
    189216        
    190        $_ctx->dlManager_item->relname = 
    191                dirname(substr($_ctx->dlManager_item->relname,$page_root_len)); 
    192           if ($_ctx->dlManager_item->relname == '.') 
    193           { 
    194                $_ctx->dlManager_item->relname = ''; 
     217       $_ctx->items->relname = 
     218               dirname(substr($_ctx->items->relname,$page_root_len)); 
     219          if ($_ctx->items->relname == '.') 
     220          { 
     221               $_ctx->items->relname = ''; 
    195222          } 
    196223           
    197224          # if visitor asked a directory 
    198           $_ctx->dlManager_currentDir = $_ctx->dlManager_item->relname; 
     225          $_ctx->dlManager_currentDir = $_ctx->items->relname; 
    199226          $page_dir = $page_root.'/'.$_ctx->dlManager_currentDir; 
    200227           
     
    203230          # /BreadCrumb 
    204231           
     232          # download counter 
     233          $_ctx->dlManager_count_dl = 
     234               unserialize($core->blog->settings->dlmanager_count_dl); 
     235          if (!is_array($_ctx->dlManager_count_dl)) 
     236          { 
     237               $_ctx->dlManager_count_dl = array(); 
     238          } 
     239           
    205240          $core->tpl->setPath($core->tpl->getPath(), 
    206241               dirname(__FILE__).'/default-templates/'); 
    207242 
    208243          if (preg_match('#^.*\/js$#',$args)) { 
    209                self::serveDocument('media_player_js.html','text/html'); 
     244               self::serveDocument('_media_player_content.html','text/html'); 
    210245          }  
    211246          else { 
     
    315350$core->tpl->addValue('DLMBreadCrumbDirURL',array('dlManagerPageTpl', 
    316351     'breadCrumbDirURL')); 
    317 $core->tpl->addBlock('DLMBreadCrumbSeparator',array('dlManagerPageTpl', 
    318      'breadCrumbSeparator')); 
    319352 
    320353# items 
     
    322355 
    323356$core->tpl->addBlock('DLMIfNoItem',array('dlManagerPageTpl','ifNoItem')); 
    324  
    325 $core->tpl->addBlock('DLMHeader',array('dlManagerPageTpl','header')); 
    326 $core->tpl->addBlock('DLMFooter',array('dlManagerPageTpl','footer')); 
    327357 
    328358# item 
     
    350380     'itemImageThumbPath')); 
    351381 
    352 $core->tpl->addBlock('DLMDownloadCounter',array('dlManagerPageTpl','downloadCounter')); 
     382$core->tpl->addBlock('DLMIfDownloadCounter',array('dlManagerPageTpl','ifDownloadCounter')); 
    353383 
    354384# image meta 
     
    370400     'itemEntries')); 
    371401 
     402#  
     403$core->tpl->addValue('DLMPageLinks',array('dlManagerPageTpl', 
     404     'pageLinks')); 
     405 
    372406if ($core->blog->settings->dlmanager_attachment_url) 
    373407{ 
     
    436470     public static function breadCrumb($attr,$content) 
    437471     { 
    438           return("<?php ". 
    439           '$_ctx->dlManagerBCIndex = 0;'. 
    440           'foreach ($_ctx->dlManager_BreadCrumb as $k => $v) {'. 
    441                '?>'. 
     472          return('<?php while ($_ctx->dlManager_BreadCrumb->fetch()) : ?>'. 
    442473               $content. 
    443           '<?php $_ctx->dlManagerBCIndex += 1; }'. 
    444           'unset($_ctx->dlManagerBCIndex,$k,$v);'. 
    445           "?>"); 
     474          '<?php endwhile; ?>'); 
    446475     } 
    447476      
     
    454483          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    455484 
    456           return('<?php echo('.sprintf($f,'$v').'); ?>'); 
     485          return('<?php echo('.sprintf($f,'$_ctx->dlManager_BreadCrumb->url').'); ?>'); 
    457486     } 
    458487 
     
    465494          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    466495 
    467           return('<?php echo('.sprintf($f,'$k').'); ?>'); 
    468      } 
    469  
    470      /** 
    471      BreadCrumb separator 
     496          return('<?php echo('.sprintf($f,'$_ctx->dlManager_BreadCrumb->name').'); ?>'); 
     497     } 
     498      
     499     /** 
     500     No item 
    472501     @param    attr <b>array</b>   Attribute 
    473502     @param    content   <b>string</b>  Content 
    474503     @return   <b>string</b> PHP block 
    475504     */ 
    476      public static function breadCrumbSeparator($attr,$content) 
    477      { 
    478           $equal = (((isset($attr['last'])) && ($attr['last'] == 1)) ? '=' : ''); 
    479  
    480           return('<?php if ($_ctx->dlManagerBCIndex <'.$equal. 
    481                ' (count($_ctx->dlManager_BreadCrumb)-1)) : ?>'. 
     505     public static function ifNoItem($attr,$content) 
     506     { 
     507          $type = ($attr['type'] == 'dirs') ? 'dirs' : 'files'; 
     508 
     509          return('<?php if (count($_ctx->{\'dlManager_'.$type.'\'}) == 0) : ?>'. 
    482510          $content. 
    483511          '<?php endif; ?>'); 
     
    485513      
    486514     /** 
    487      No item 
     515     loop on items 
    488516     @param    attr <b>array</b>   Attribute 
    489517     @param    content   <b>string</b>  Content 
    490518     @return   <b>string</b> PHP block 
    491519     */ 
    492      public static function ifNoItem($attr,$content) 
     520     public static function items($attr,$content) 
    493521     { 
    494522          $type = ($attr['type'] == 'dirs') ? 'dirs' : 'files'; 
    495  
    496           return('<?php if (count($core->media->dir[\''.$type.'\']) == 0) : ?>'. 
     523           
     524          return 
     525          '<?php '. 
     526          '$_ctx->items = dlManager::getItems($_ctx->{\'dlManager_'.$type.'\'}); '. 
     527          'while ($_ctx->items->fetch()) : ?>'."\n". 
    497528          $content. 
    498           '<?php endif; ?>'); 
    499      } 
    500       
    501      /** 
    502      loop on items 
    503      @param    attr <b>array</b>   Attribute 
    504      @param    content   <b>string</b>  Content 
    505      @return   <b>string</b> PHP block 
    506      */ 
    507      public static function items($attr,$content) 
    508      { 
    509           $type = ($attr['type'] == 'dirs') ? 'dirs' : 'files'; 
    510           return("<?php ". 
    511           '$_ctx->dlManager_items = $core->media->dir[\''.$type.'\'];'. 
    512           "if (\$_ctx->dlManager_items !== null) :"."\n". 
    513           '$_ctx->dlManager_index = 0;'. 
    514           "foreach (\$_ctx->dlManager_items as \$_ctx->dlManager_item) { ". 
    515           "?>"."\n". 
    516           $content. 
    517           '<?php $_ctx->dlManager_index += 1; } '."\n". 
    518           " endif;"."\n". 
    519           'unset($_ctx->dlManager_item,$_ctx->dlManager_index); ?>'); 
    520      } 
    521  
    522      /** 
    523      Header 
    524      @param    attr <b>array</b>   Attribute 
    525      @param    content   <b>string</b>  Content 
    526      @return   <b>string</b> PHP block 
    527      */ 
    528      public static function header($attr,$content) 
    529      { 
    530           return('<?php if ($_ctx->dlManager_index == 0) : ?>'. 
    531           $content. 
    532           '<?php endif; ?>'); 
    533      } 
    534  
    535      /** 
    536      Footer 
    537      @param    attr <b>array</b>   Attribute 
    538      @param    content   <b>string</b>  Content 
    539      @return   <b>string</b> PHP block 
    540      */ 
    541      public static function footer($attr,$content) 
    542      { 
    543           return('<?php if ($_ctx->dlManager_index == '. 
    544           '(count($_ctx->dlManager_items)-1)) : ?>'. 
    545           $content. 
    546           '<?php endif; ?>'); 
     529          '<?php endwhile; unset($_ctx->items); ?>'; 
    547530     } 
    548531      
     
    555538     { 
    556539          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    557           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->dir_url').'; ?>'); 
     540          return('<?php echo '.sprintf($f,'$_ctx->items->dir_url').'; ?>'); 
    558541     } 
    559542      
     
    566549          global $core; 
    567550          return('<?php echo '. 
    568                'dlManager::pageURL().'. 
    569                '((!empty($_ctx->dlManager_item->relname)) ?'. 
    570                '\'/\'.$_ctx->dlManager_item->relname : \'\'); ?>'); 
     551               # empty can't be used with $_ctx->items->relname, use strlen() instead 
     552               'dlManager::pageURL().'.'((strlen($_ctx->items->relname) > 0) ?'. 
     553               '\'/\'.$_ctx->items->relname : \'\'); ?>'); 
    571554     } 
    572555      
     
    594577               foreach ($types as $type) 
    595578               { 
    596                     $if[] = '$_ctx->dlManager_item->type '.$sign.'= "'.$type.'"'; 
     579                    $if[] = '$_ctx->items->type '.$sign.'= "'.$type.'"'; 
    597580               } 
    598581          } 
     
    609592               foreach ($types as $type) 
    610593               { 
    611                     $if[] = '$_ctx->dlManager_item->media_type '.$sign.'= "'.$type.'"'; 
     594                    $if[] = '$_ctx->items->media_type '.$sign.'= "'.$type.'"'; 
    612595               } 
    613596          } 
     
    651634     {          
    652635          return('<?php echo $core->blog->url.$core->url->getBase(\'icon\').'. 
    653                '\'/\'.$_ctx->dlManager_item->media_type; ?>'); 
     636               '\'/\'.$_ctx->items->media_type; ?>'); 
    654637     } 
    655638      
     
    664647          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    665648           
    666           return('<?php echo '.sprintf($f, 
    667                '$_ctx->dlManager_item->media_title').'; ?>'); 
     649          return('<?php echo '.sprintf($f,'$_ctx->items->media_title').'; ?>'); 
    668650     } 
    669651      
     
    684666 
    685667          return('<?php echo '.sprintf($f, 
    686                $format_open.'$_ctx->dlManager_item->size'.$format_close).'; ?>'); 
     668               $format_open.'$_ctx->items->size'.$format_close).'; ?>'); 
    687669     } 
    688670      
     
    696678          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    697679           
    698           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->file_url').'; ?>'); 
     680          return('<?php echo '.sprintf($f,'$_ctx->items->file_url').'; ?>'); 
    699681     } 
    700682      
     
    709691 
    710692          return('<?php echo($core->blog->url.$core->url->getBase(\'download\').'. 
    711                '\'/\'.'.sprintf($f,'$_ctx->dlManager_item->media_id').'); ?>'); 
     693               '\'/\'.'.sprintf($f,'$_ctx->items->media_id').'); ?>'); 
    712694     } 
    713695      
     
    722704 
    723705          return('<?php echo($core->blog->url.$core->url->getBase(\'mediaplayer\').'. 
    724                '\'/\'.'.sprintf($f,'$_ctx->dlManager_item->media_id').'); ?>'); 
     706               '\'/\'.'.sprintf($f,'$_ctx->items->media_id').'); ?>'); 
    725707     } 
    726708      
     
    734716          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    735717           
    736           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->basename').'; ?>'); 
     718          return('<?php echo '.sprintf($f,'$_ctx->items->basename').'; ?>'); 
    737719     } 
    738720      
     
    746728          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    747729           
    748           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->extension').'; ?>'); 
     730          return('<?php echo '.sprintf($f,'$_ctx->items->extension').'; ?>'); 
    749731     } 
    750732      
     
    758740          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    759741           
    760           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->type').'; ?>'); 
     742          return('<?php echo '.sprintf($f,'$_ctx->items->type').'; ?>'); 
    761743     } 
    762744 
     
    770752          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    771753           
    772           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->media_type').'; ?>'); 
     754          return('<?php echo '.sprintf($f,'$_ctx->items->media_type').'; ?>'); 
    773755     } 
    774756 
     
    782764          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    783765           
    784           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->media_dtstr').'; ?>'); 
     766          return('<?php echo '.sprintf($f,'$_ctx->items->media_dtstr').'; ?>'); 
    785767     } 
    786768      
     
    790772     @return   <b>string</b> PHP block 
    791773     */ 
    792      public static function itemDlCount($attr) 
    793      { 
    794           $f = $GLOBALS['core']->tpl->getFilters($attr); 
    795            
     774     public static function itemDlCount() 
     775     { 
    796776          return  
    797                '<?php $count = unserialize($core->blog->settings->dlmanager_count_dl); '. 
    798                'if (empty($count)) {$count = array();}'. 
    799                'echo '.sprintf($f,'array_key_exists($_ctx->dlManager_item->media_id,'. 
    800                     '$count) ? $count[$_ctx->dlManager_item->media_id] : "0"'). 
    801                '; ?>'; 
     777               '<?php echo (array_key_exists($_ctx->items->media_id,'. 
     778                    '$_ctx->dlManager_count_dl) ? $_ctx->dlManager_count_dl[$_ctx->items->media_id] : "0"); ?>'; 
    802779     } 
    803780 
     
    808785     @return   <b>string</b> PHP block 
    809786     */ 
    810      public static function downloadCounter($attr,$content) 
     787     public static function ifDownloadCounter($attr,$content) 
    811788     { 
    812789          return('<?php if ($core->blog->settings->dlmanager_counter) : ?>'. 
     
    830807          {$size = $attr['size'];} 
    831808 
    832           return('<?php if (isset($_ctx->dlManager_item->media_thumb[\''. 
     809          return('<?php if (isset($_ctx->items->media_thumb[\''. 
    833810               $size.'\'])) :'. 
    834           'echo($_ctx->dlManager_item->media_thumb[\''.$size.'\']);'. 
     811          'echo($_ctx->items->media_thumb[\''.$size.'\']);'. 
    835812          'else :'. 
    836           'echo($_ctx->dlManager_item->file_url);'. 
     813          'echo($_ctx->items->file_url);'. 
    837814          'endif; ?>'); 
    838815     } 
     
    846823     public static function itemImageMeta($attr,$content) 
    847824     { 
    848           return("<?php ". 
    849           '$_ctx->dlManager_index = 0;'. 
    850           '$_ctx->dlManager_items = new ArrayObject();'. 
    851           'foreach ($_ctx->dlManager_item->media_meta as $k => $v) {'. 
    852           'if (!empty($v)) {$_ctx->dlManager_items[$k] = $v;}'. 
    853           '}'. 
    854           'foreach ($_ctx->dlManager_items as $name => $value) { ?>'."\n". 
    855           $content. 
    856           '<?php '. 
    857           '$_ctx->dlManager_index += 1; } '."\n". 
    858           'unset($_ctx->dlManager_items,$_ctx->dlManager_item,'. 
    859                '$_ctx->dlManager_index); ?>'); 
    860      } 
    861       
    862      /** 
    863      Image meta name 
    864      @param    attr <b>array</b>   Attribute 
    865      @return   <b>string</b> PHP block 
    866      */ 
    867      public static function itemImageMetaName($attr) 
    868      { 
    869           $f = $GLOBALS['core']->tpl->getFilters($attr); 
    870            
    871           return('<?php echo '.sprintf($f,'$name').'; ?>'); 
    872      } 
    873       
    874      /** 
    875      Image meta value 
    876      @param    attr <b>array</b>   Attribute 
    877      @return   <b>string</b> PHP block 
    878      */ 
    879      public static function itemImageMetaValue($attr) 
    880      { 
    881           $f = $GLOBALS['core']->tpl->getFilters($attr); 
    882            
    883           return('<?php echo '.sprintf($f,'$value').'; ?>'); 
    884      } 
    885       
    886      /** 
    887      Loop on zip content 
    888      @param    attr <b>array</b>   Attribute 
    889      @return   <b>string</b> PHP block 
    890      */ 
    891      public static function itemZipContent($attr,$content) 
    892      { 
    893           $f = $GLOBALS['core']->tpl->getFilters($attr); 
    894            
    895825          return 
    896826          '<?php '. 
    897           '$_ctx->dlManager_index = 0;'. 
    898           '$content = $core->media->getZipContent($_ctx->dlManager_item); '. 
    899           'foreach ($content as $file => $v) { '. 
    900           '?>'."\n". 
     827          '$_ctx->meta = dlManager::getImageMeta($_ctx->items); '. 
     828          'while ($_ctx->meta->fetch()) : ?>'."\n". 
    901829          $content. 
    902           '<?php $_ctx->dlManager_index += 1; '. 
    903           '}'. 
    904           'unset($content,$_ctx->dlManager_index,$file); ?>'; 
     830          '<?php endwhile; unset($_ctx->meta); ?>'; 
     831     } 
     832      
     833     /** 
     834     Image meta name 
     835     @param    attr <b>array</b>   Attribute 
     836     @return   <b>string</b> PHP block 
     837     */ 
     838     public static function itemImageMetaName($attr) 
     839     { 
     840          $f = $GLOBALS['core']->tpl->getFilters($attr); 
     841           
     842          return('<?php echo '.sprintf($f,'$_ctx->meta->name').'; ?>'); 
     843     } 
     844      
     845     /** 
     846     Image meta value 
     847     @param    attr <b>array</b>   Attribute 
     848     @return   <b>string</b> PHP block 
     849     */ 
     850     public static function itemImageMetaValue($attr) 
     851     { 
     852          $f = $GLOBALS['core']->tpl->getFilters($attr); 
     853           
     854          return('<?php echo '.sprintf($f,'$_ctx->meta->value').'; ?>'); 
     855     } 
     856      
     857     /** 
     858     Loop on zip content 
     859     @param    attr <b>array</b>   Attribute 
     860     @return   <b>string</b> PHP block 
     861     */ 
     862     public static function itemZipContent($attr,$content) 
     863     { 
     864          $f = $GLOBALS['core']->tpl->getFilters($attr); 
     865           
     866          return 
     867          '<?php '. 
     868          '$_ctx->files = dlManager::getZipContent($_ctx->items); '. 
     869          'while ($_ctx->files->fetch()) : ?>'."\n". 
     870          $content. 
     871          '<?php endwhile; unset($_ctx->files); ?>'; 
    905872     } 
    906873      
     
    914881          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    915882           
    916           return('<?php echo '.sprintf($f,'$file').'; ?>'); 
     883          return('<?php echo '.sprintf($f,'$_ctx->files->file').'; ?>'); 
    917884     } 
    918885      
     
    926893     { 
    927894          return("<?php ". 
    928           '$_ctx->posts = dlManager::findPosts($_ctx->dlManager_item->media_id);'. 
    929           '$_ctx->dlManager_index = 0;'. 
    930           "if (!\$_ctx->posts->isEmpty()) :"."\n". 
     895          '$_ctx->posts = dlManager::findPosts($_ctx->items->media_id);'. 
    931896          "while (\$_ctx->posts->fetch()) : ?>"."\n". 
    932897          $content. 
    933           "<?php \$_ctx->dlManager_index += 1;". 
    934           "endwhile; "."\n". 
    935           " endif;"."\n". 
    936           "unset(\$_ctx->posts,\$_ctx->dlManager_index); ?>"); 
    937      } 
    938       
    939      public function AttachmentURL($attr) 
     898          "<?php endwhile; unset(\$_ctx->posts); ?>"); 
     899     } 
     900      
     901     /** 
     902     redefine {{tpl:AttachmentURL}} to point to download/id 
     903     @param    attr <b>array</b>   Attribute 
     904     @return   <b>string</b> PHP block 
     905     */ 
     906     public static function AttachmentURL($attr) 
    940907     { 
    941908          $f = $GLOBALS['core']->tpl->getFilters($attr); 
     
    943910          return('<?php echo($core->blog->url.$core->url->getBase(\'download\').'. 
    944911               '\'/\'.'.sprintf($f,'$attach_f->media_id').'); ?>'); 
     912     } 
     913      
     914     /** 
     915     get page links 
     916     @return   <b>string</b> PHP block 
     917     */ 
     918     public static function pageLinks() 
     919     { 
     920          return('<?php echo($_ctx->dlManager_pager->getLinks()); ?>'); 
    945921     } 
    946922} 
     
    10281004                              'pf=dlManager/images/image.png" alt="'.__('Preview').'" />'. 
    10291005                              '</a>'; 
    1030                     } elseif ($item->type == 'audio/mpeg3' || $item->type == 'video/x-flv') 
     1006                    } elseif ($item->type == 'audio/mpeg3' ) 
    10311007                    { 
    10321008                         $mediaplayer = '<a href="'.$core->blog->url.$core->url->getBase('mediaplayer').'/'. 
    10331009                              $item->media_id.'" title="'.__('Preview :').' '.$item->media_title.'">'. 
    10341010                         '<img src="'.$core->blog->getQmarkURL(). 
    1035                          'pf=dlManager/images/control_play.png" alt="'.__('Preview').'" />'. 
     1011                         'pf=dlManager/images/music.png" alt="'.__('Preview').'" />'. 
     1012                         '</a>'; 
     1013                    } elseif ($item->type == 'video/x-flv') 
     1014                    { 
     1015                         $mediaplayer = '<a href="'.$core->blog->url.$core->url->getBase('mediaplayer').'/'. 
     1016                              $item->media_id.'" title="'.__('Preview :').' '.$item->media_title.'">'. 
     1017                         '<img src="'.$core->blog->getQmarkURL(). 
     1018                         'pf=dlManager/images/film.png" alt="'.__('Preview').'" />'. 
    10361019                         '</a>'; 
    10371020                    } elseif ($item->type == 'application/zip') 
  • plugins/dlManager/default-templates/_media_player_content.html

    r547 r548  
    1616               <tpl:DLMBreadCrumb> 
    1717                    <a href="{{tpl:DLMBreadCrumbDirURL}}"> 
    18                          {{tpl:DLMBreadCrumbDirName}}</a> 
    19                     <tpl:DLMBreadCrumbSeparator last="1"> /  
    20                          </tpl:DLMBreadCrumbSeparator> 
     18                         {{tpl:DLMBreadCrumbDirName}}</a> / 
    2119               </tpl:DLMBreadCrumb> 
    2220               {{tpl:DLMItemBasename}} 
     
    4947                    <h3>{{tpl:lang Zip file content}}</h3> 
    5048                    <tpl:DLMItemZipContent> 
    51                          <tpl:DLMHeader> 
     49                         <tpl:LoopPosition start="1" length="1"> 
    5250                              <ul> 
    53                          </tpl:DLMHeader> 
     51                         </tpl:LoopPosition> 
    5452                         <li>{{tpl:DLMItemZipContentFile}}</li> 
    55                          <tpl:DLMFooter> 
     53                         <tpl:LoopPosition start="-1"> 
    5654                              </ul> 
    57                          </tpl:DLMFooter> 
     55                         </tpl:LoopPosition> 
    5856                    </tpl:DLMItemZipContent> 
    5957               </tpl:DLMItemIf> 
    60           </div> 
     58          </div><!-- End #player --> 
    6159           
    6260          <h3>{{tpl:lang Informations}}</h3> 
     
    7068               <dt>{{tpl:lang Modification time}}</dt> 
    7169               <dd>{{tpl:DLMItemMTime}}</dd> 
    72                <tpl:DLMDownloadCounter> 
     70               <tpl:DLMIfDownloadCounter> 
    7371                    <dt>{{tpl:lang Download number}}</dt> 
    7472                    <dd>{{tpl:DLMItemDlCount}}</dd> 
    75                </tpl:DLMDownloadCounter> 
     73               </tpl:DLMIfDownloadCounter> 
    7674          </dl> 
    7775           
    7876          <tpl:DLMItemIf media_type="image"> 
    7977               <tpl:DLMItemImageMeta> 
    80                     <tpl:DLMHeader> 
     78                    <tpl:LoopPosition start="1" length="1"> 
    8179                         <h3>{{tpl:lang Image meta}}</h3> 
    8280                         <dl> 
    83                     </tpl:DLMHeader> 
     81                    </tpl:LoopPosition> 
    8482                    <dt>{{tpl:DLMItemImageMetaName}}</dt> 
    8583                    <dd>{{tpl:DLMItemImageMetaValue}}</dd> 
    86                     <tpl:DLMFooter> 
     84                    <tpl:LoopPosition start="-1"> 
    8785                         </dl> 
    88                     </tpl:DLMFooter> 
     86                    </tpl:LoopPosition> 
    8987               </tpl:DLMItemImageMeta> 
    9088          </tpl:DLMItemIf> 
    9189           
    9290          <tpl:DLMItemEntries> 
    93                <tpl:DLMHeader> 
     91               <tpl:LoopPosition start="1" length="1"> 
    9492                    <h3>{{tpl:lang Entries containing this media}}</h3> 
    9593                    <ul> 
    96                </tpl:DLMHeader> 
     94               </tpl:LoopPosition> 
    9795               <li> 
    9896                    <a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}} 
    9997                    ({{tpl:EntryDate format="%d/%m/%Y"}})</a> 
    10098               </li> 
    101                <tpl:DLMFooter> 
     99               <tpl:LoopPosition start="-1"> 
    102100                    </ul> 
    103                </tpl:DLMFooter> 
     101               </tpl:LoopPosition> 
    104102          </tpl:DLMItemEntries> 
    105103     </div><!-- End #dlmanager --> 
  • plugins/dlManager/default-templates/media.html

    r547 r548  
    2020   
    2121  <style type="text/css"> 
    22      .center {text-align:center;} 
    23      .size {white-space:pre;} 
    24      .number {text-align:right;} 
    25      .TB_overlayMacFFBGHack {background: url({{tpl:BlogURL}}pf=dlManager/default-templates/macFFBgHack.png) repeat;} 
     22          .center {text-align:center;} 
     23          .size {white-space:pre;} 
     24          .number {text-align:right;} 
     25          .TB_overlayMacFFBGHack {background: url({{tpl:BlogURL}}pf=dlManager/images/macFFBgHack.png) repeat;} 
    2626  </style> 
    2727 
     
    2929 
    3030  {{tpl:include src="_head.html"}} 
    31  
    32   <script type="text/javascript"> 
    33      $(document).ready(function () {  
    34           var tb_pathToImage = "{{tpl:BlogURL}}pf=dlManager/default-templates/loadingAnimation.gif"; 
    35           $("a.thickbox").each(function() { 
    36                $(this).attr("href",this.href+"/js"); 
     31   
     32     <script type="text/javascript" src="{{tpl:BlogURL}}pf=dlManager/js/thickbox.js"></script> 
     33      
     34     <script type="text/javascript"> 
     35     //<![CDATA[ 
     36       /* define this before $(document).ready() to avoid an error */ 
     37       var tb_pathToImage = "{{tpl:BlogURL}}pf=dlManager/images/loadingAnimation.gif"; 
     38          $(document).ready(function () {  
     39               $("a.thickbox").each(function() { 
     40                    $(this).attr("href",this.href+"/js"); 
     41               }); 
    3742          }); 
    38      }); 
     43     //]]> 
    3944  </script> 
    40   <script type="text/javascript" src="{{tpl:BlogURL}}pf=dlManager/default-templates/thickbox.js"></script> 
    4145</head> 
    4246 
     
    6771               <tpl:DLMBreadCrumb> 
    6872                    <a href="{{tpl:DLMBreadCrumbDirURL}}"> 
    69                          {{tpl:DLMBreadCrumbDirName}}</a> 
    70                     <tpl:DLMBreadCrumbSeparator last="0"> /  
    71                          </tpl:DLMBreadCrumbSeparator> 
     73                         {{tpl:DLMBreadCrumbDirName}}</a> / 
    7274               </tpl:DLMBreadCrumb> 
    7375          </p> 
     
    8082 
    8183          <tpl:DLMItems type="dirs"> 
    82                <tpl:DLMHeader> 
     84               <tpl:LoopPosition start="1" length="1"> 
    8385                    <ul id="dlmanager-dirs"> 
    84                </tpl:DLMHeader> 
     86               </tpl:LoopPosition> 
    8587                    <li><a href="{{tpl:DLMItemDirPath}}"> 
    8688                         {{tpl:DLMItemBasename}}</a></li> 
    87                <tpl:DLMFooter> 
     89               <tpl:LoopPosition start="-1"> 
    8890                    </ul> 
    89                </tpl:DLMFooter> 
     91               </tpl:LoopPosition> 
    9092          </tpl:DLMItems> 
    9193 
     
    107109 
    108110          <tpl:DLMItems type="files"> 
    109                <tpl:DLMHeader> 
     111               <tpl:LoopPosition start="1" length="1"> 
    110112                    <table rules="rows" id="dlmanager-files"> 
    111113                         <thead> 
     
    121123                                   <!-- #<th>{{tpl:lang Extension}}</th>--> 
    122124                                   <th>{{tpl:lang Modification time}}</th> 
    123                                    <tpl:DLMDownloadCounter> 
     125                                   <tpl:DLMIfDownloadCounter> 
    124126                                        <th>{{tpl:lang Downloads}}</th> 
    125                                    </tpl:DLMDownloadCounter> 
     127                                   </tpl:DLMIfDownloadCounter> 
    126128                              </tr> 
    127129                         </thead> 
    128130                         <tbody> 
    129                </tpl:DLMHeader> 
     131               </tpl:LoopPosition> 
    130132               <tr class="{{tpl:DLMItemMediaType}}"> 
    131133                    <td><img src="{{tpl:DLMItemIconPath}}" width="48" height="48" title="{{tpl:DLMItemMediaType}}" alt="{{tpl:DLMItemMediaType}}" /></td> 
     
    142144                              </a> 
    143145                         </tpl:DLMItemIf> 
    144                          <!-- # mp3 and flv files --> 
    145                          <tpl:DLMItemIf operator="or" type="audio/mpeg3,video/x-flv"> 
    146                               <a href="{{tpl:DLMItemPlayerURL}}" class="preview thickbox" title="{{tpl:lang Preview :}} {{tpl:DLMItemBasename}}"> 
    147                                    <img src="{{tpl:BlogQmarkURL}}pf=dlManager/images/control_play.png" alt="{{tpl:lang Preview}}" /> 
     146                         <!-- # mp3 files --> 
     147                         <tpl:DLMItemIf type="audio/mpeg3"> 
     148                              <a href="{{tpl:DLMItemPlayerURL}}" class="preview thickbox" title="{{tpl:lang Preview :}} {{tpl:DLMItemBasename}}"> 
     149                                   <img src="{{tpl:BlogQmarkURL}}pf=dlManager/images/music.png" alt="{{tpl:lang Preview}}" /> 
     150                              </a> 
     151                         </tpl:DLMItemIf> 
     152                         <!-- # flv files --> 
     153                         <tpl:DLMItemIf type="video/x-flv"> 
     154                              <a href="{{tpl:DLMItemPlayerURL}}" class="preview thickbox" title="{{tpl:lang Preview :}} {{tpl:DLMItemBasename}}"> 
     155                                   <img src="{{tpl:BlogQmarkURL}}pf=dlManager/images/film.png" alt="{{tpl:lang Preview}}" /> 
    148156                              </a> 
    149157                         </tpl:DLMItemIf> 
     
    154162                              </a> 
    155163                         </tpl:DLMItemIf> 
    156                               
    157164                    </td> 
    158165                    <td class="size">{{tpl:DLMItemSize format="1"}}</td> 
     
    164171                         return "txt" --> 
    165172                    <td>{{tpl:DLMItemMTime}}</td> 
    166                     <tpl:DLMDownloadCounter> 
     173                    <tpl:DLMIfDownloadCounter> 
    167174                         <td class="number">{{tpl:DLMItemDlCount}}</td> 
    168                     </tpl:DLMDownloadCounter> 
     175                    </tpl:DLMIfDownloadCounter> 
    169176               </tr> 
    170                <tpl:DLMFooter> 
     177               <tpl:LoopPosition start="-1"> 
    171178                    </tbody> 
    172179                    </table> 
    173                </tpl:DLMFooter> 
     180                    <p>{{tpl:DLMPageLinks}}</p> 
     181               </tpl:LoopPosition> 
    174182          </tpl:DLMItems> 
    175183     </div><!-- End #dlmanager --> 
  • plugins/dlManager/default-templates/media_player.html

    r544 r548  
    3535     <div id="content"> 
    3636 
    37 <div class="content-inner"> 
    38      <div id="content-info"> 
    39           <h2> 
    40                {{tpl:lang Download manager}} - {{tpl:lang Preview}} 
    41           </h2> 
    42      </div> 
    43            
    44      <tpl:SysIfFormError> 
    45           <div class="error">{{tpl:SysFormError}}</div> 
    46      </tpl:SysIfFormError> 
    47  
    48      <div id="dlmanager"> 
    49           <p> 
    50                <a href="{{tpl:DLMBaseURL}}">{{tpl:lang Home}}</a> / 
    51                <!-- # loop on directory path, display dir / subdir --> 
    52                <tpl:DLMBreadCrumb> 
    53                     <a href="{{tpl:DLMBreadCrumbDirURL}}"> 
    54                          {{tpl:DLMBreadCrumbDirName}}</a> 
    55                     <tpl:DLMBreadCrumbSeparator last="1"> /  
    56                          </tpl:DLMBreadCrumbSeparator> 
    57                </tpl:DLMBreadCrumb> 
    58                {{tpl:DLMItemBasename}} 
    59           </p> 
    60            
    61           <p><a href="{{tpl:DLMItemDirPath}}">{{tpl:lang Get back to the directory}}</a></p> 
    62            
    63           <h3> 
    64                <a href="{{tpl:DLMItemDlURL}}" title="{{tpl:DLMItemBasename}}"> 
    65                     {{tpl:lang Download this file}} 
    66                </a> 
    67           </h3> 
    68            
    69           <div id="player"> 
    70                <tpl:DLMItemIf media_type="image"> 
    71                     <a href="{{tpl:DLMItemDlURL}}" title="{{tpl:DLMItemBasename}}"> 
    72                          <img src="{{tpl:DLMItemImageThumbPath size="m"}}" alt="{{tpl:DLMItemTitle}}" /> 
    73                     </a> 
    74                </tpl:DLMItemIf> 
    75                 
    76                <tpl:DLMItemIf type="audio/mpeg3"> 
    77                     {{tpl:include src="_mp3_player.html"}} 
    78                </tpl:DLMItemIf> 
    79                 
    80                <tpl:DLMItemIf type="video/x-flv"> 
    81                     {{tpl:include src="_flv_player.html"}} 
    82                </tpl:DLMItemIf> 
    83                 
    84                <tpl:DLMItemIf type="application/zip"> 
    85                     <h3>{{tpl:lang Zip file content}}</h3> 
    86                     <tpl:DLMItemZipContent> 
    87                          <tpl:DLMHeader> 
    88                               <ul> 
    89                          </tpl:DLMHeader> 
    90                          <li>{{tpl:DLMItemZipContentFile}}</li> 
    91                          <tpl:DLMFooter> 
    92                               </ul> 
    93                          </tpl:DLMFooter> 
    94                     </tpl:DLMItemZipContent> 
    95                </tpl:DLMItemIf> 
    96           </div> 
    97            
    98           <h3>{{tpl:lang Informations}}</h3> 
    99           <dl> 
    100                <dt>{{tpl:lang Basename}}</dt> 
    101                <dd>{{tpl:DLMItemBasename}}</dd> 
    102                <dt>{{tpl:lang Type}}</dt> 
    103                <dd>{{tpl:DLMItemType}}</dd> 
    104                <dt>{{tpl:lang Size}}</dt> 
    105                <dd>{{tpl:DLMItemSize format="1"}}</dd> 
    106                <dt>{{tpl:lang Modification time}}</dt> 
    107                <dd>{{tpl:DLMItemMTime}}</dd> 
    108                <tpl:DLMDownloadCounter> 
    109                     <dt>{{tpl:lang Download number}}</dt> 
    110                     <dd>{{tpl:DLMItemDlCount}}</dd> 
    111                </tpl:DLMDownloadCounter> 
    112           </dl> 
    113            
    114           <tpl:DLMItemIf media_type="image"> 
    115                <tpl:DLMItemImageMeta> 
    116                     <tpl:DLMHeader> 
    117                          <h3>{{tpl:lang Image meta}}</h3> 
    118                          <dl> 
    119                     </tpl:DLMHeader> 
    120                     <dt>{{tpl:DLMItemImageMetaName}}</dt> 
    121                     <dd>{{tpl:DLMItemImageMetaValue}}</dd> 
    122                     <tpl:DLMFooter> 
    123                          </dl> 
    124                     </tpl:DLMFooter> 
    125                </tpl:DLMItemImageMeta> 
    126           </tpl:DLMItemIf> 
    127            
    128           <tpl:DLMItemEntries> 
    129                <tpl:DLMHeader> 
    130                     <h3>{{tpl:lang Entries containing this media}}</h3> 
    131                     <ul> 
    132                </tpl:DLMHeader> 
    133                <li> 
    134                     <a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}} 
    135                     ({{tpl:EntryDate format="%d/%m/%Y"}})</a> 
    136                </li> 
    137                <tpl:DLMFooter> 
    138                     </ul> 
    139                </tpl:DLMFooter> 
    140           </tpl:DLMItemEntries> 
    141      </div><!-- End #dlmanager --> 
    142  
    143 </div><!-- End #content-inner --> 
     37{{tpl:include src="_media_player_content.html"}} 
    14438   
    14539     </div><!-- End #content --> 
  • plugins/dlManager/lib.dlManager.php

    r546 r548  
    2121# 
    2222# ***** END LICENSE BLOCK ***** 
     23 
     24if (!defined('DC_RC_PATH')) {return;} 
    2325 
    2426/** 
     
    99101     make BreadCrumb 
    100102     @param    dir  <b>string</b>  path directory 
    101      @return   <b>array</b> BreadCrumb 
     103     @return   <b>record</b> BreadCrumb 
    102104     */ 
    103105     public static function breadCrumb($dir) 
     
    118120               { 
    119121                    $path = (($path == '') ? $dir : $path.'/'.$dir);  
    120                     $breadCrumb[$dir] = $base_url.$path; 
    121                } 
    122           } 
    123            
    124           if (empty($breadCrumb)) {$breadCrumb = array();} 
    125            
    126           return($breadCrumb); 
     122                    $breadCrumb[] = array( 
     123                         'name' => $dir, 
     124                         'url' => $base_url.$path 
     125                    ); 
     126               } 
     127          } 
     128           
     129          return(staticRecord::newFromArray($breadCrumb)); 
    127130     } 
    128131      
     
    144147           
    145148          return true; 
     149     } 
     150      
     151     /** 
     152     get a static record for items 
     153     @param    array     <b>array</b>   path directory 
     154     @return   <b>record</b> Items 
     155     */ 
     156     public static function getItems($array) 
     157     { 
     158          global $core; 
     159           
     160          $items = array(); 
     161                     
     162          foreach ($array as $k => $v) 
     163          { 
     164               $items[] = array( 
     165                    'dir_url' => $v->dir_url, 
     166                    'relname' => $v->relname, 
     167                    'media_type' => $v->media_type, 
     168                    'media_title' => $v->media_title, 
     169                    'size' => $v->size, 
     170                    'file_url' => $v->file_url, 
     171                    'media_id' => $v->media_id, 
     172                    'media_id' => $v->media_id, 
     173                    'basename' => $v->basename, 
     174                    'extension' => $v->extension, 
     175                    'type' => $v->type, 
     176                    'media_type' => $v->media_type, 
     177                    'media_dtstr' => $v->media_dtstr, 
     178                    'media_thumb' => $v->media_thumb 
     179               ); 
     180          } 
     181           
     182          return(staticRecord::newFromArray($items)); 
     183     } 
     184      
     185     /** 
     186     get zip content (files) of a media item 
     187     @param    array     <b>fileItem</b>     File item 
     188     @return   <b>record</b> Files 
     189     */ 
     190     public static function getZipContent($item) 
     191     { 
     192          global $core; 
     193           
     194          $files = array(); 
     195           
     196          $content = $core->media->getZipContent($item); 
     197           
     198          foreach ($content as $file => $v) 
     199          { 
     200               $files[] = array('file' => $file); 
     201          } 
     202           
     203          return(staticRecord::newFromArray($files)); 
     204     } 
     205      
     206     /** 
     207     get image metadata a media item 
     208     @param    array     <b>fileItem</b>     File item 
     209     @return   <b>record</b> Image metadata 
     210     */ 
     211     public static function getImageMeta($item) 
     212     { 
     213          global $core; 
     214           
     215          $meta = array(); 
     216                     
     217          foreach ($item->media_meta as $k => $v) 
     218          { 
     219               if (!empty($v)) 
     220               { 
     221                    $meta[] = array( 
     222                         'name' => $k , 
     223                         'value' => $v 
     224                    ); 
     225               } 
     226          } 
     227           
     228          return(staticRecord::newFromArray($meta)); 
    146229     } 
    147230      
  • plugins/dlManager/locales/fr/main.po

    r544 r548  
    33"Project-Id-Version: DL Manager\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2008-11-04 20:13+0100\n" 
    6 "PO-Revision-Date: 2008-11-04 20:19+0100\n" 
     5"POT-Creation-Date: 2008-11-06 21:20+0100\n" 
     6"PO-Revision-Date: 2008-11-06 21:21+0100\n" 
    77"Last-Translator: Moe <poedit@gniark.net>\n" 
    88"Language-Team: Moe <poedit@gniark.net>\n" 
     
    1818 
    1919#: _public.php:130 
    20 #: public_l10n.php:7 
    2120msgid "parent directory" 
    2221msgstr "répertoire parent" 
    2322 
    24 #: _public.php:1007 
    25 #: _public.php:1014 
    26 #: _public.php:1021 
     23#: _public.php:144 
     24msgid "previous page" 
     25msgstr "page précédente" 
     26 
     27#: _public.php:145 
     28msgid "next page" 
     29msgstr "page suivante" 
     30 
     31#: _public.php:990 
     32#: _public.php:997 
     33#: _public.php:1004 
     34#: public_l10n.php:21 
    2735msgid "Preview :" 
    2836msgstr "" 
    2937 
    30 #: _public.php:1009 
    31 #: _public.php:1016 
    32 #: _public.php:1023 
     38#: _public.php:992 
     39#: _public.php:999 
     40#: _public.php:1006 
     41#: public_l10n.php:22 
    3342msgid "Preview" 
    3443msgstr "" 
    3544 
    36 #: lib.dlManager.php:83 
     45#: lib.dlManager.php:82 
    3746msgid "By names, ascendant" 
    3847msgstr "Par noms, croissants" 
    3948 
    40 #: lib.dlManager.php:84 
     49#: lib.dlManager.php:83 
    4150msgid "By names, descendant" 
    4251msgstr "Par noms, décroissants" 
    4352 
    44 #: lib.dlManager.php:85 
     53#: lib.dlManager.php:84 
    4554msgid "By dates, ascendant" 
    4655msgstr "Par dates, croissantes" 
    4756 
    48 #: lib.dlManager.php:86 
     57#: lib.dlManager.php:85 
    4958msgid "By dates, descendant" 
    5059msgstr "Par dates, décroissantes" 
    5160 
    52 #: _admin.php:70 
    53 #: _admin.php:75 
     61#: _admin.php:26 
     62#: index.php:76 
     63#: index.php:80 
     64msgid "Download Manager" 
     65msgstr "Gestionnaire de téléchargements" 
     66 
     67#: _admin.php:50 
     68#: _admin.php:54 
    5469#: _admin.php:80 
    55 #: _admin.php:94 
    56 #: _admin.php:121 
    57 #: _admin.php:129 
    58 #: _admin.php:131 
    59 #: _admin.php:137 
    60 #: _admin.php:142 
    61 #: _admin.php:147 
    62 #: _admin.php:162 
    63 #: _admin.php:166 
    64 #: _admin.php:192 
    65 #: _admin.php:193 
    66 #: public_l10n.php:3 
     70#: _admin.php:81 
     71#: public_l10n.php:5 
     72#: index.php:88 
     73#: index.php:93 
     74#: index.php:98 
     75#: index.php:112 
     76#: index.php:147 
     77#: index.php:155 
     78#: index.php:157 
     79#: index.php:163 
     80#: index.php:169 
     81#: index.php:175 
    6782msgid "Download manager" 
    6883msgstr "Gestionnaire de téléchargements" 
    6984 
    70 #: _admin.php:75 
    71 #, php-format 
    72 msgid "Enable the %s" 
    73 msgstr "Activer %s" 
    74  
    75 #: _admin.php:79 
    76 #, php-format 
    77 msgid "The %s display media on a public page." 
    78 msgstr "Le %s affiche les médias sur une page publique." 
    79  
    80 #: _admin.php:86 
    81 msgid "Enable the download counter" 
    82 msgstr "Activer le compteur de téléchargements" 
    83  
    84 #: _admin.php:93 
    85 #, php-format 
    86 msgid "Redirect attachments links to %s" 
    87 msgstr "Rediriger les liens des pièces jointes vers %s" 
    88  
    89 #: _admin.php:98 
    90 msgid "When downloading an attachment, the download counter will be increased." 
    91 msgstr "Lors du téléchargement d'une pièce jointe, le compteur de téléchargements sera augmenté." 
    92  
    93 #: _admin.php:99 
    94 #, php-format 
    95 msgid "This will redefine the %s tag." 
    96 msgstr "Ceci redéfinira la balise %s." 
    97  
    98 #: _admin.php:106 
    99 msgid "Allow visitors to choose how to sort files" 
    100 msgstr "Autoriser les visiteurs à choisir l'ordre des fichiers" 
    101  
    102 #: _admin.php:111 
    103 #: _admin.php:168 
    104 #: public_l10n.php:5 
     85#: _admin.php:53 
     86msgid "Title:" 
     87msgstr "Titre :" 
     88 
     89#: _admin.php:53 
     90#: _admin.php:66 
     91#: _admin.php:72 
     92#: _admin.php:81 
     93msgid "optional" 
     94msgstr "facultatif" 
     95 
     96#: _admin.php:56 
     97#: public_l10n.php:24 
     98#: index.php:137 
    10599msgid "Sort files:" 
    106100msgstr "Trier les fichiers&nbsp;:" 
    107101 
    108 #: _admin.php:117 
    109 #: _admin.php:127 
    110 msgid "Leave empty to cancel this feature." 
    111 msgstr "" 
    112  
    113 #: _admin.php:121 
    114 #, php-format 
    115 msgid "Change root of %s:" 
    116 msgstr "Changer la racine de %s&nbsp;:" 
    117  
    118 #: _admin.php:128 
    119 #, php-format 
    120 msgid "This will change the root of the %s page and of the widget." 
    121 msgstr "Ceci changera la racine de la page %s et du widget." 
    122  
    123 #: _admin.php:130 
    124 #, php-format 
    125 msgid "If you change this setting, reconfigure the %s widget." 
    126 msgstr "Si vous changez ce paramètre, reconfigurez le widget %s." 
    127  
    128 #: _admin.php:136 
    129 #, php-format 
    130 msgid "Files can be excluded from %1$s by editing <strong>%2$s</strong> in <strong>%3$s</strong>." 
    131 msgstr "Les fichiers peuvent être exclus de %1$s en éditant <strong>%2$s</strong> dans <strong>%3$s</strong>." 
    132  
    133 #: _admin.php:137 
    134 msgid "about:config" 
    135 msgstr "" 
    136  
    137 #: _admin.php:138 
    138 #, php-format 
    139 msgid "For example, to exclude %1$s and %2$s files : <code>%3$s</code>" 
    140 msgstr "Par exemple, pour exclure les fichiers %1$s et %2$s : <code>%3$s</code>" 
    141  
    142 #: _admin.php:139 
    143 msgid "PNG" 
    144 msgstr "" 
    145  
    146 #: _admin.php:139 
    147 msgid "JPG" 
    148 msgstr "" 
    149  
    150 #: _admin.php:142 
    151 #, php-format 
    152 msgid "URL of the %s page :" 
    153 msgstr "URL de la page %s&nbsp;:" 
    154  
    155 #: _admin.php:146 
    156 #, php-format 
    157 msgid "View the %s page" 
    158 msgstr "Voir la page %s" 
    159  
    160 #: _admin.php:165 
    161 msgid "Title:" 
    162 msgstr "Titre :" 
    163  
    164 #: _admin.php:165 
    165 #: _admin.php:178 
    166 #: _admin.php:184 
    167 #: _admin.php:193 
    168 msgid "optional" 
    169 msgstr "facultatif" 
    170  
    171 #: _admin.php:171 
     102#: _admin.php:59 
    172103msgid "root directory:" 
    173104msgstr "répertoire de base :" 
    174105 
    175 #: _admin.php:174 
     106#: _admin.php:62 
    176107msgid "Display subdirectories" 
    177108msgstr "Afficher les sous-répertoires&nbsp;:" 
    178109 
    179 #: _admin.php:177 
     110#: _admin.php:65 
    180111msgid "Subdirectories title:" 
    181112msgstr "Titre des sous-répertoires&nbsp;:" 
    182113 
    183 #: _admin.php:178 
    184 #: public_l10n.php:6 
     114#: _admin.php:66 
     115#: public_l10n.php:4 
    185116msgid "Directories" 
    186117msgstr "Répertoires" 
    187118 
    188 #: _admin.php:180 
     119#: _admin.php:68 
    189120msgid "Display files" 
    190121msgstr "Afficher les fichiers" 
    191122 
    192 #: _admin.php:183 
     123#: _admin.php:71 
    193124msgid "Files title:" 
    194125msgstr "Titre des fichiers&nbsp;:" 
    195126 
    196 #: _admin.php:184 
     127#: _admin.php:72 
    197128#: public_l10n.php:12 
    198129msgid "Files" 
    199130msgstr "Fichiers" 
    200131 
    201 #: _admin.php:186 
     132#: _admin.php:74 
    202133msgid "Block display:" 
    203134msgstr "Affichage du bloc&nbsp;:" 
    204135 
    205 #: _admin.php:188 
     136#: _admin.php:76 
    206137msgid "Item display:" 
    207138msgstr "Affichage d'un élément&nbsp;:" 
    208139 
    209 #: _admin.php:192 
     140#: _admin.php:80 
    210141#, php-format 
    211142msgid "Add a link to %s in the widget:" 
    212143msgstr "Ajouter un lien vers %s dans le widget&nbsp;:" 
    213144 
    214 #: _admin.php:195 
     145#: _admin.php:83 
    215146msgid "Home page only" 
    216147msgstr "" 
    217148 
     149#: public_l10n.php:2 
     150msgid "Archives" 
     151msgstr "" 
     152 
     153#: public_l10n.php:3 
     154msgid "Basename" 
     155msgstr "Nom du fichier" 
     156 
     157#: public_l10n.php:6 
     158msgid "Download number" 
     159msgstr "Nombre de téléchargements" 
     160 
     161#: public_l10n.php:7 
     162msgid "Download this file" 
     163msgstr "Télécharger ce fichier" 
     164 
     165#: public_l10n.php:8 
     166msgid "Downloads" 
     167msgstr "Téléchargements" 
     168 
    218169#: public_l10n.php:9 
     170msgid "Entries containing this media" 
     171msgstr "Billets contenant ce média" 
     172 
     173#: public_l10n.php:10 
     174msgid "Extension" 
     175msgstr "Extension" 
     176 
     177#: public_l10n.php:11 
     178msgid "File" 
     179msgstr "Fichier" 
     180 
     181#: public_l10n.php:13 
     182msgid "Get back to the directory" 
     183msgstr "Revenir au répertoire" 
     184 
     185#: public_l10n.php:14 
     186msgid "Home" 
     187msgstr "" 
     188 
     189#: public_l10n.php:15 
     190msgid "Image meta" 
     191msgstr "Méta données" 
     192 
     193#: public_l10n.php:16 
     194msgid "Informations" 
     195msgstr "Informations" 
     196 
     197#: public_l10n.php:17 
     198msgid "Media type" 
     199msgstr "Type de média" 
     200 
     201#: public_l10n.php:18 
     202msgid "Modification time" 
     203msgstr "Date de modification" 
     204 
     205#: public_l10n.php:19 
    219206msgid "No directory." 
    220207msgstr "Aucun répertoire." 
    221208 
    222 #: public_l10n.php:10 
     209#: public_l10n.php:20 
    223210msgid "No file." 
    224211msgstr "Aucun fichier." 
    225212 
    226 #: public_l10n.php:13 
    227 msgid "Basename" 
    228 msgstr "Nom du fichier" 
    229  
    230 #: public_l10n.php:14 
    231 msgid "File" 
    232 msgstr "Fichier" 
    233  
    234 #: public_l10n.php:15 
    235 msgid "Title" 
    236 msgstr "Titre" 
    237  
    238 #: public_l10n.php:16 
     213#: public_l10n.php:23 
    239214msgid "Size" 
    240215msgstr "Taille" 
    241216 
    242 #: public_l10n.php:17 
     217#: public_l10n.php:25 
    243218msgid "Type" 
    244219msgstr "Type" 
    245220 
    246 #: public_l10n.php:18 
    247 msgid "Media type" 
    248 msgstr "Type de média" 
    249  
    250 #: public_l10n.php:19 
    251 msgid "Extension" 
    252 msgstr "Extension" 
    253  
    254 #: public_l10n.php:20 
    255 msgid "Modification time" 
    256 msgstr "Date de modification" 
    257  
    258 #: public_l10n.php:21 
    259 msgid "Download number" 
    260 msgstr "Nombre de téléchargements" 
    261  
    262 #: public_l10n.php:22 
    263 msgid "Downloads" 
    264 msgstr "Téléchargements" 
    265  
    266 #: public_l10n.php:25 
    267 msgid "Get back to the directory" 
    268 msgstr "Revenir au répertoire" 
    269  
    270221#: public_l10n.php:26 
    271 msgid "Download this file" 
    272 msgstr "Télécharger ce fichier" 
    273  
    274 #: public_l10n.php:27 
    275 msgid "Image meta" 
    276 msgstr "Méta données" 
    277  
    278 #: public_l10n.php:28 
    279222msgid "Zip file content" 
    280223msgstr "Contenu du fichier zip" 
    281224 
    282 #: public_l10n.php:29 
    283 msgid "Entries containing this media" 
    284 msgstr "Billets contenant ce média" 
    285  
    286 #~ msgid "Display a subdirectory :" 
    287 #~ msgstr "Afficher un sous-répertoire :" 
    288 #~ msgid "The public directory will be displayed." 
    289 #~ msgstr "Le répertoire public sera affiché." 
    290  
     225#: index.php:70 
     226msgid "Configuration successfully updated." 
     227msgstr "Configuration mise à jour avec succès." 
     228 
     229#: index.php:93 
     230#, php-format 
     231msgid "Enable the %s" 
     232msgstr "Activer %s" 
     233 
     234#: index.php:97 
     235#, php-format 
     236msgid "The %s display media on a public page." 
     237msgstr "Le %s affiche les médias sur une page publique." 
     238 
     239#: index.php:104 
     240msgid "Enable the download counter" 
     241msgstr "Activer le compteur de téléchargements" 
     242 
     243#: index.php:111 
     244#, php-format 
     245msgid "Redirect attachments links to %s" 
     246msgstr "Rediriger les liens des pièces jointes vers %s" 
     247 
     248#: index.php:116 
     249msgid "When downloading an attachment, the download counter will be increased." 
     250msgstr "Lors du téléchargement d'une pièce jointe, le compteur de téléchargements sera augmenté." 
     251 
     252#: index.php:117 
     253#, php-format 
     254msgid "This will redefine the %s tag." 
     255msgstr "Ceci redéfinira la balise %s." 
     256 
     257#: index.php:122 
     258msgid "Files per page:" 
     259msgstr "Fichiers par page&nbsp;:" 
     260 
     261#: index.php:132 
     262msgid "Allow visitors to choose how to sort files" 
     263msgstr "Autoriser les visiteurs à choisir l'ordre des fichiers" 
     264 
     265#: index.php:143 
     266#: index.php:153 
     267msgid "Leave empty to cancel this feature." 
     268msgstr "" 
     269 
     270#: index.php:147 
     271#, php-format 
     272msgid "Change root of %s:" 
     273msgstr "Changer la racine de %s&nbsp;:" 
     274 
     275#: index.php:154 
     276#, php-format 
     277msgid "This will change the root of the %s page and of the widget." 
     278msgstr "Ceci changera la racine de la page %s et du widget." 
     279 
     280#: index.php:156 
     281#, php-format 
     282msgid "If you change this setting, reconfigure the %s widget." 
     283msgstr "Si vous changez ce paramètre, reconfigurez le widget %s." 
     284 
     285#: index.php:162 
     286#, php-format 
     287msgid "Files can be excluded from %1$s by editing %2$s in %3$s." 
     288msgstr "Les fichiers peuvent être exclus de %1$s en éditant %2$s< dans %3$s." 
     289 
     290#: index.php:165 
     291#, php-format 
     292msgid "For example, to exclude %1$s and %2$s files : <code>%3$s</code>" 
     293msgstr "Par exemple, pour exclure les fichiers %1$s et %2$s : <code>%3$s</code>" 
     294 
     295#: index.php:169 
     296#, php-format 
     297msgid "URL of the %s page :" 
     298msgstr "URL de la page %s&nbsp;:" 
     299 
     300#: index.php:174 
     301#, php-format 
     302msgid "View the %s page" 
     303msgstr "Voir la page %s" 
     304 
     305#: index.php:180 
     306msgid "Save configuration" 
     307msgstr "Enregistrer la configuration" 
     308 
  • plugins/dlManager/public_l10n.php

    r544 r548  
    11<?php 
    2 # media.html 
    3 __('Download manager'); 
    4  
    5 __('Sort files:'); 
    6 __('Directories'); 
    7 __('parent directory'); 
    8  
    9 __('No directory.'); 
    10 __('No file.'); 
    11  
    12 __('Files'); 
    13 __('Basename'); 
    14 __('File'); 
    15 __('Title'); 
    16 __('Size'); 
    17 __('Type'); 
    18 __('Media type'); 
    19 __('Extension'); 
    20 __('Modification time'); 
    21 __('Download number'); 
    22 __('Downloads'); 
    23  
    24 # media_item.html 
    25 __('Get back to the directory'); 
    26 __('Download this file'); 
    27 __('Image meta'); 
    28 __('Zip file content'); 
    29 __('Entries containing this media'); 
     2__("Archives"); 
     3__("Basename"); 
     4__("Directories"); 
     5__("Download manager"); 
     6__("Download number"); 
     7__("Download this file"); 
     8__("Downloads"); 
     9__("Entries containing this media"); 
     10__("Extension"); 
     11__("File"); 
     12__("Files"); 
     13__("Get back to the directory"); 
     14__("Home"); 
     15__("Image meta"); 
     16__("Informations"); 
     17__("Media type"); 
     18__("Modification time"); 
     19__("No directory."); 
     20__("No file."); 
     21__("Preview :"); 
     22__("Preview"); 
     23__("Size"); 
     24__("Sort files:"); 
     25__("Type"); 
     26__("Zip file content"); 
    3027?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map