Dotclear

Changeset 526


Ignore:
Timestamp:
10/20/08 22:19:17 (15 years ago)
Author:
Moe
google:author:
appears
Message:

DL Manager 1.0-beta2 :

  • added media icons
  • improved english strings
Location:
plugins/dlManager
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • plugins/dlManager/_admin.php

    r522 r526  
    4545          $settings->setNameSpace('dlmanager'); 
    4646          $settings->put('dlmanager_active',!empty($_POST['dlmanager_active']), 
    47                'boolean','Activate DL Manager'); 
     47               'boolean','Enable DL Manager'); 
    4848          $settings->put('dlmanager_enable_sort',!empty($_POST['dlmanager_enable_sort']), 
    4949               'boolean','Allow visitors to choose how to sort files'); 
     
    7070          form::checkbox('dlmanager_active',1,$core->blog->settings->dlmanager_active). 
    7171          '<label class="classic" for="dlmanager_active">'. 
    72           sprintf(__('Activate %s'),__('Download manager')). 
     72          sprintf(__('Enable the %s page'),__('Download manager')). 
    7373          '</label>'. 
    7474          '</p>'. 
    7575          '<p class="form-note">'. 
    76           sprintf(__('%s display media on a public page.'),__('Download manager')). 
     76          sprintf(__('The %s page display media on a public page.'),__('Download manager')). 
    7777          '</p>'. 
    7878          '<p>'. 
     
    9595          '<p>'. 
    9696          '<label for="dlmanager_root">'. 
    97           __('Limit display to a subdirectory :'). 
     97          __('Display a subdirectory :'). 
    9898          form::combo('dlmanager_root',dlManager::listDirs(), 
    9999               $core->blog->settings->dlmanager_root). 
     
    102102          '<p class="form-note">'. 
    103103          __('Leave empty to cancel this feature.').' '. 
    104           __('The public directory will be used.'). 
     104          __('The public directory will be displayed.'). 
    105105          '</p>'. 
    106106          # filemanager->$exclude_list is protected 
     
    112112          '</p>'. 
    113113          '<p>'. 
    114           sprintf(__('URL of the %s :'),__('Download manager')). 
     114          sprintf(__('URL of the %s page :'),__('Download manager')). 
    115115          '<br />'. 
    116116          '<code>'.dlManager::pageURL().'</code>'. 
    117117          '<br />'. 
    118           '<a href="'.dlManager::pageURL().'">'.sprintf(__('View %s'),__('Download manager')).'</a>'.     
     118          '<a href="'.dlManager::pageURL().'">'.sprintf(__('View the %s page'),__('Download manager')).'</a>'.      
    119119          '</p>'. 
    120120          '</fieldset>'; 
  • plugins/dlManager/_define.php

    r522 r526  
    2626     /* Description*/                "Download manager with a public page and a widget", 
    2727     /* Author */                    "Moe (http://gniark.net/), Osku and Tomtom (http://blog.zenstyle.fr)", 
    28      /* Version */                   '1.0-beta1', 
     28     /* Version */                   '1.0-beta2', 
    2929     /* Permissions */               'admin' 
    3030); 
  • plugins/dlManager/_install.php

    r522 r526  
    4646'setting_id = replace(setting_id,\'publicmedia_page\',\'dlmanager\') '. 
    4747'WHERE (setting_id LIKE \'publicmedia_%\');'); 
     48 
    4849# change namespace of settings 
    4950$cur = $core->con->openCursor($core->prefix.'setting'); 
  • plugins/dlManager/_prepend.php

    r522 r526  
    2828$core->url->register('download','download', 
    2929          '^download/([0-9]+)$',array('dlManagerPageDocument','wrapper')); 
     30$core->url->register('icon','icon', 
     31          '^icon/(.+)?$',array('dlManagerPageDocument','icon')); 
    3032 
    3133?> 
  • plugins/dlManager/_public.php

    r522 r526  
    4949          { 
    5050               $_ctx =& $GLOBALS['_ctx']; 
    51  
     51                
     52               # exit if the public_path (and Media root) doesn't exist 
     53               if (!is_dir($core->blog->public_path)) {self::p404();} 
     54                
    5255               if (!is_object($core->media)) 
    5356               { 
     
    178181          global $core; 
    179182 
    180           if (empty($args) || $core->blog->settings->dlmanager_active == '0') { 
     183          if (empty($args) || !$core->blog->settings->dlmanager_active) { 
    181184               self::p404(); 
    182185          } 
     
    199202          }          
    200203             
    201           if ($file->file && is_readable($file->file)) { 
     204          if ($file->file && is_readable($file->file)) 
     205          { 
    202206               $count = unserialize($core->blog->settings->dlmanager_count_dl); 
    203207               $count[$file->media_id] = array_key_exists($file->media_id,$count) ? $count[$file->media_id]+1 : 1; 
     
    221225          self::p404(); 
    222226     } 
     227      
     228     /** 
     229     serve files icons 
     230     @param    args <b>string</b>  Argument 
     231     */ 
     232     public static function icon($args) 
     233     { 
     234          global $core; 
     235 
     236          if (empty($args) || (!$core->blog->settings->dlmanager_active) 
     237               || (!preg_match('/^[a-z]+$/',$args))) 
     238          { 
     239               self::p404(); 
     240          } 
     241           
     242          $icon_path = path::real(DC_ROOT.'/admin/images/media/'.$args.'.png'); 
     243           
     244          try 
     245          { 
     246               if (is_readable($icon_path)) 
     247               { 
     248                    # from /dotclear/inc/load_plugin_file.php 
     249                    http::cache(array_merge(array($icon_path),get_included_files())); 
     250                    header('Content-type: '.files::getMimeType($icon_path)); 
     251                    header('Content-Length: '.filesize($icon_path)); 
     252                    readfile($icon_path); 
     253                    exit; 
     254                    # /from /dotclear/inc/load_plugin_file.php 
     255               } 
     256          } 
     257          catch (Exception $e) 
     258          { 
     259               $core->error->add($e->getMessage()); 
     260          } 
     261     } 
    223262} 
    224263 
     
    267306$core->tpl->addValue('DLMItemDirPath',array('dlManagerPageTpl','itemDirPath')); 
    268307 
     308$core->tpl->addValue('DLMItemIconPath',array('dlManagerPageTpl','itemIconPath')); 
    269309$core->tpl->addValue('DLMItemTitle',array('dlManagerPageTpl','itemTitle')); 
    270310$core->tpl->addValue('DLMItemSize',array('dlManagerPageTpl','itemSize')); 
     
    550590      
    551591     /** 
     592     Item icon path 
     593     @param    attr <b>array</b>   Attribute 
     594     @param    content   <b>string</b>  Content 
     595     @return   <b>string</b> PHP block 
     596     */ 
     597     public static function itemIconPath($attr) 
     598     {          
     599          return('<?php echo $core->blog->url.$core->url->getBase(\'download\').\'/\'.$_ctx->dlManager_item->media_type; ?>'); 
     600     } 
     601      
     602     /** 
    552603     Item title 
    553604     @param    attr <b>array</b>   Attribute 
     
    561612          return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->media_title').'; ?>'); 
    562613     } 
     614      
    563615     /** 
    564616     Item size 
     
    579631               $format_open.'$_ctx->dlManager_item->size'.$format_close).'; ?>'); 
    580632     } 
     633      
    581634     /** 
    582635     Item file URL 
     
    590643          return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->file_url').'; ?>'); 
    591644     } 
     645      
    592646     /** 
    593647     Item download URL 
     
    600654 
    601655          return('<?php echo($core->blog->url.$core->url->getBase(\'download\').\'/\'.'.sprintf($f,'$_ctx->dlManager_item->media_id').'); ?>'); 
    602      }          
     656     } 
     657      
    603658     /** 
    604659     Item basename 
     
    612667          return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->basename').'; ?>'); 
    613668     } 
     669      
    614670     /** 
    615671     Item extension 
     
    623679          return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->extension').'; ?>'); 
    624680     } 
     681      
    625682     /** 
    626683     Item type : text/plain 
  • plugins/dlManager/default-templates/media.html

    r522 r526  
    9494                         <thead> 
    9595                              <tr> 
     96                                   <th>{{tpl:lang Type}}</th> 
    9697                                   <th title="{{tpl:lang Basename}} - {{tpl:lang Extension}}"> 
    97                                         {{tpl:lang Title}} 
     98                                        {{tpl:lang File}} 
    9899                                   </th> 
    99100                                   <th>{{tpl:lang Size}}</th> 
     
    108109               </tpl:DLMHeader> 
    109110               <tr class="{{tpl:DLMItemMediaType}}"> 
     111                    <td><img src="{{tpl:DLMItemIconPath}}" width="48" height="48" alt="{{tpl:DLMItemMediaType}}" /></td> 
    110112                    <td> 
    111113                         <!-- # do not insert a newline after <tpl:DLMItemSwitch> --> 
  • plugins/dlManager/locales/fr/main.po

    r522 r526  
    33"Project-Id-Version: Public Media\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2008-10-13 20:43+0100\n" 
    6 "PO-Revision-Date: 2008-10-13 20:43+0100\n" 
     5"POT-Creation-Date: 2008-10-20 22:11+0100\n" 
     6"PO-Revision-Date: 2008-10-20 22:11+0100\n" 
    77"Last-Translator: Moe <poedit@gniark.net>\n" 
    88"Language-Team: Moe <poedit@gniark.net>\n" 
     
    1717"X-Poedit-SearchPath-0: .\n" 
    1818 
    19 #: public_l10n.php:2 
     19#: _public.php:152 
     20#: public_l10n.php:6 
     21msgid "parent directory" 
     22msgstr "répertoire parent" 
     23 
     24#: lib.dlManager.php:69 
     25msgid "By names, ascendant" 
     26msgstr "Par noms, croissants" 
     27 
     28#: lib.dlManager.php:70 
     29msgid "By names, descendant" 
     30msgstr "Par noms, décroissants" 
     31 
     32#: lib.dlManager.php:71 
     33msgid "By dates, ascendant" 
     34msgstr "Par dates, croissantes" 
     35 
     36#: lib.dlManager.php:72 
     37msgid "By dates, descendant" 
     38msgstr "Par dates, décroissantes" 
     39 
    2040#: _admin.php:68 
    2141#: _admin.php:72 
     
    2848#: _admin.php:149 
    2949#: _admin.php:150 
     50#: public_l10n.php:2 
    3051msgid "Download manager" 
    3152msgstr "Gestionnaire de téléchargements" 
    3253 
    33 #: public_l10n.php:4 
    34 #: _admin.php:87 
    35 #: _admin.php:137 
    36 msgid "Sort files:" 
    37 msgstr "Trier les fichiers :" 
    38  
    39 #: public_l10n.php:5 
    40 msgid "Directories" 
    41 msgstr "Répertoires" 
    42  
    43 #: public_l10n.php:6 
    44 #: _public.php:146 
    45 msgid "parent directory" 
    46 msgstr "répertoire parent" 
    47  
    48 #: public_l10n.php:8 
    49 msgid "No directory." 
    50 msgstr "Aucun répertoire." 
    51  
    52 #: public_l10n.php:9 
    53 msgid "No file." 
    54 msgstr "Aucun fichier." 
    55  
    56 #: public_l10n.php:11 
    57 msgid "Files" 
    58 msgstr "Fichiers" 
    59  
    60 #: public_l10n.php:12 
    61 msgid "Basename" 
    62 msgstr "Nom du fichier" 
    63  
    64 #: public_l10n.php:13 
    65 msgid "Title" 
    66 msgstr "Titre" 
    67  
    68 #: public_l10n.php:14 
    69 msgid "Size" 
    70 msgstr "Taille" 
    71  
    72 #: public_l10n.php:15 
    73 msgid "Extension" 
    74 msgstr "Extension" 
    75  
    76 #: public_l10n.php:16 
    77 msgid "Type" 
    78 msgstr "Type" 
    79  
    80 #: public_l10n.php:17 
    81 msgid "Modification time" 
    82 msgstr "Date de modification" 
    83  
    8454#: _admin.php:72 
    8555#, php-format 
    86 msgid "Activate %s" 
    87 msgstr "Activer %s" 
     56msgid "Enable the %s page" 
     57msgstr "Activer la page %s" 
    8858 
    8959#: _admin.php:76 
    9060#, php-format 
    91 msgid "%s display media on a public page." 
    92 msgstr "%s affiche les médias sur une page publique." 
     61msgid "The %s page display media on a public page." 
     62msgstr "La page %s affiche les médias sur une page publique." 
    9363 
    9464#: _admin.php:82 
     
    9666msgstr "Autoriser les visiteurs à choisir l'ordre des fichiers" 
    9767 
     68#: _admin.php:87 
     69#: _admin.php:137 
     70#: public_l10n.php:4 
     71msgid "Sort files:" 
     72msgstr "Trier les fichiers :" 
     73 
    9874#: _admin.php:93 
    9975#: _admin.php:103 
     
    10278 
    10379#: _admin.php:97 
    104 msgid "Limit display to a subdirectory :" 
    105 msgstr "Limiter l'affichage à un sous-répertoire :" 
     80msgid "Display a subdirectory :" 
     81msgstr "Afficher un sous-répertoire :" 
    10682 
    10783#: _admin.php:104 
    108 msgid "The public directory will be used." 
    109 msgstr "Le répertoire public sera utilisé." 
     84msgid "The public directory will be displayed." 
     85msgstr "Le répertoire public sera affiché." 
    11086 
    11187#: _admin.php:108 
     
    133109#: _admin.php:114 
    134110#, php-format 
    135 msgid "URL of the %s :" 
    136 msgstr "URL de la %s :" 
     111msgid "URL of the %s page :" 
     112msgstr "URL de la page %s :" 
    137113 
    138114#: _admin.php:118 
    139115#, php-format 
    140 msgid "View %s" 
    141 msgstr "Voir la %s" 
     116msgid "View the %s page" 
     117msgstr "Voir la page %s" 
    142118 
    143119#: _admin.php:135 
     
    171147msgstr "" 
    172148 
    173 #: lib.dlManager.php:69 
    174 msgid "By names, ascendant" 
    175 msgstr "Par noms, croissants" 
    176  
    177 #: lib.dlManager.php:70 
    178 msgid "By names, descendant" 
    179 msgstr "Par noms, décroissants" 
    180  
    181 #: lib.dlManager.php:71 
    182 msgid "By dates, ascendant" 
    183 msgstr "Par dates, croissantes" 
    184  
    185 #: lib.dlManager.php:72 
    186 msgid "By dates, descendant" 
    187 msgstr "Par dates, décroissantes" 
    188  
     149#: public_l10n.php:5 
     150msgid "Directories" 
     151msgstr "Répertoires" 
     152 
     153#: public_l10n.php:8 
     154msgid "No directory." 
     155msgstr "Aucun répertoire." 
     156 
     157#: public_l10n.php:9 
     158msgid "No file." 
     159msgstr "Aucun fichier." 
     160 
     161#: public_l10n.php:11 
     162msgid "Files" 
     163msgstr "Fichiers" 
     164 
     165#: public_l10n.php:12 
     166msgid "Basename" 
     167msgstr "Nom du fichier" 
     168 
     169#: public_l10n.php:13 
     170msgid "File" 
     171msgstr "Fichier" 
     172 
     173#: public_l10n.php:14 
     174msgid "Title" 
     175msgstr "Titre" 
     176 
     177#: public_l10n.php:15 
     178msgid "Size" 
     179msgstr "Taille" 
     180 
     181#: public_l10n.php:16 
     182msgid "Extension" 
     183msgstr "Extension" 
     184 
     185#: public_l10n.php:17 
     186msgid "Type" 
     187msgstr "Type" 
     188 
     189#: public_l10n.php:18 
     190msgid "Modification time" 
     191msgstr "Date de modification" 
     192 
     193#: public_l10n.php:19 
     194msgid "Download number" 
     195msgstr "Nombre de téléchargements" 
     196 
     197#~ msgid "Activate the %s page" 
     198#~ msgstr "Activer la page %s" 
    189199#~ msgid "Media" 
    190200#~ msgstr "Médias" 
  • plugins/dlManager/public_l10n.php

    r522 r526  
    1111__('Files'); 
    1212__('Basename'); 
     13__('File'); 
    1314__('Title'); 
    1415__('Size'); 
     
    1617__('Type'); 
    1718__('Modification time'); 
     19__('Download number'); 
    1820?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map