Dotclear

Changeset 527


Ignore:
Timestamp:
10/21/08 01:13:46 (15 years ago)
Author:
Moe
google:author:
appears
Message:

DL Manager 1.0-beta3 :

  • fixed stupid bug with copy and pasted code
  • added line breaks to shorten long code lines
Location:
plugins/dlManager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/dlManager/_admin.php

    r526 r527  
    6868          '<legend>'.__('Download manager').'</legend>'. 
    6969          '<p>'. 
    70           form::checkbox('dlmanager_active',1,$core->blog->settings->dlmanager_active). 
     70          form::checkbox('dlmanager_active',1, 
     71               $core->blog->settings->dlmanager_active). 
    7172          '<label class="classic" for="dlmanager_active">'. 
    7273          sprintf(__('Enable the %s page'),__('Download manager')). 
     
    7475          '</p>'. 
    7576          '<p class="form-note">'. 
    76           sprintf(__('The %s page display media on a public page.'),__('Download manager')). 
     77          sprintf(__('The %s page display media on a public page.'), 
     78               __('Download manager')). 
    7779          '</p>'. 
    7880          '<p>'. 
     
    107109          '<p>'. 
    108110               sprintf(__('Files can be excluded from %1$s by editing <strong>%2$s</strong> in <strong>%3$s</strong>.'), 
    109                __('Download manager'),'           media_exclusion',__('about:config')).' '. 
     111               __('Download manager'),'media_exclusion',__('about:config')).' '. 
    110112               sprintf(__('For example, to exclude %1$s and %2$s files : <code>%3$s</code>'), 
    111113               __('PNG'),__('JPG'),'/\.(png|jpg)/i'). 
     
    116118          '<code>'.dlManager::pageURL().'</code>'. 
    117119          '<br />'. 
    118           '<a href="'.dlManager::pageURL().'">'.sprintf(__('View the %s page'),__('Download manager')).'</a>'.      
     120          '<a href="'.dlManager::pageURL().'">'.sprintf(__('View the %s page'), 
     121               __('Download manager')).'</a>'.     
    119122          '</p>'. 
    120123          '</fieldset>'; 
  • plugins/dlManager/_define.php

    r526 r527  
    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-beta2', 
     28     /* Version */                   '1.0-beta3', 
    2929     /* Permissions */               'admin' 
    3030); 
  • plugins/dlManager/_public.php

    r526 r527  
    168168          } 
    169169 
    170           $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'); 
     170          $core->tpl->setPath($core->tpl->getPath(), 
     171               dirname(__FILE__).'/default-templates/'); 
    171172 
    172173          self::serveDocument('media.html','text/html'); 
     
    205206          { 
    206207               $count = unserialize($core->blog->settings->dlmanager_count_dl); 
    207                $count[$file->media_id] = array_key_exists($file->media_id,$count) ? $count[$file->media_id]+1 : 1; 
     208               $count[$file->media_id] = array_key_exists($file->media_id,$count) 
     209                    ? $count[$file->media_id]+1 : 1; 
    208210               if (!is_object($core->blog->settings)) 
    209211               { 
     
    215217               } 
    216218               $settings->setNamespace('dlmanager'); 
    217                $settings->put('dlmanager_count_dl',serialize($count),'string','Download counter'); 
     219               $settings->put('dlmanager_count_dl',serialize($count),'string', 
     220                    'Download counter'); 
    218221               //$core->callBehavior('publicDownloadedFile',(integer)$args); 
    219222               header('Content-type: '.$file->type); 
     
    516519     public static function footer($attr,$content) 
    517520     { 
    518           return('<?php if ($_ctx->dlManager_index == (count($_ctx->dlManager_items)-1)) : ?>'. 
     521          return('<?php if ($_ctx->dlManager_index == '. 
     522          '(count($_ctx->dlManager_items)-1)) : ?>'. 
    519523          $content. 
    520524          '<?php endif; ?>'); 
     
    597601     public static function itemIconPath($attr) 
    598602     {          
    599           return('<?php echo $core->blog->url.$core->url->getBase(\'download\').\'/\'.$_ctx->dlManager_item->media_type; ?>'); 
     603          return('<?php echo $core->blog->url.$core->url->getBase(\'icon\').'. 
     604               '\'/\'.$_ctx->dlManager_item->media_type; ?>'); 
    600605     } 
    601606      
     
    610615          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    611616           
    612           return('<?php echo '.sprintf($f,'$_ctx->dlManager_item->media_title').'; ?>'); 
     617          return('<?php echo '.sprintf($f, 
     618               '$_ctx->dlManager_item->media_title').'; ?>'); 
    613619     } 
    614620      
     
    653659          $f = $GLOBALS['core']->tpl->getFilters($attr); 
    654660 
    655           return('<?php echo($core->blog->url.$core->url->getBase(\'download\').\'/\'.'.sprintf($f,'$_ctx->dlManager_item->media_id').'); ?>'); 
     661          return('<?php echo($core->blog->url.$core->url->getBase(\'download\').'. 
     662               '\'/\'.'.sprintf($f,'$_ctx->dlManager_item->media_id').'); ?>'); 
    656663     } 
    657664      
     
    728735               '<?php $count = unserialize($core->blog->settings->dlmanager_count_dl); '. 
    729736               'if (empty($count)) {$count = array();}'. 
    730                'echo '.sprintf($f,'array_key_exists($_ctx->dlManager_item->media_id,$count) ? $count[$_ctx->dlManager_item->media_id] : "0"'). 
     737               'echo '.sprintf($f,'array_key_exists($_ctx->dlManager_item->media_id,'. 
     738                    '$count) ? $count[$_ctx->dlManager_item->media_id] : "0"'). 
    731739               '; ?>'; 
    732740     } 
     
    794802 
    795803          foreach ($items as $media_item) { 
    796                $items_str .= sprintf($w->item,$core->blog->url.$core->url->getBase('download').'/'.$media_item->media_id, 
     804               $items_str .= sprintf($w->item,$core->blog->url. 
     805                    $core->url->getBase('download').'/'.$media_item->media_id, 
    797806                    $media_item->media_title,$media_item->basename); 
    798807          } 
     
    805814          $str = sprintf($w->block,$items_str); 
    806815 
    807           $link = (strlen($w->link) > 0) ? '<p class="text"><a href="'.dlManager::pageURL().'">'. 
    808                html::escapeHTML($w->link).'</a></p>' : null; 
     816          $link = (strlen($w->link) > 0) ? '<p class="text"><a href="'. 
     817               dlManager::pageURL().'">'.html::escapeHTML($w->link).'</a></p>' : null; 
    809818 
    810819          return '<div class="dlmanager">'.$header.$str.$link.'</div>'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map