Changeset 16626


Ignore:
Timestamp:
07/11/12 18:45:20 (7 years ago)
Author:
mistic100
Message:

-better support of Stripped

Location:
extensions/BatchDownloader
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/admin/template/style.css

    r16622 r16626  
    3232} 
    3333.table2 .date { 
    34   width:190px; 
     34  width:200px; 
    3535} 
    3636.table2 .size { 
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r16622 r16626  
    426426  function getDownloadList($url='') 
    427427  { 
     428    if ($this->data['nb_images'] == 0) 
     429    { 
     430      return '<b>'.l10n('No archive').'</b>'; 
     431    } 
     432     
    428433    $out = ''; 
    429434    for ($i=1; $i<=$this->data['nb_zip']; $i++) 
     
    490495      'DATE_CREATION' => format_date($this->data['date_creation'], true), 
    491496      ); 
    492          
    493     if ($this->data['status'] == 'new') 
    494     { 
    495       $set['U_EDIT_SET'] = BATCH_DOWNLOAD_PUBLIC . 'view&amp;set_id='.$this->data['set_id']; 
    496     } 
    497497     
    498498    switch ($this->data['type']) 
  • extensions/BatchDownloader/include/download.inc.php

    r16609 r16626  
    3131        $next_file = $BatchDownloader->createNextArchive(); 
    3232      } 
    33  
     33       
    3434      $set = $BatchDownloader->getSetInfo(); 
    3535       
     
    3838        $set['U_DOWNLOAD'] = BATCH_DOWNLOAD_PATH . 'download.php?set_id='.$_GET['set_id'].'&amp;zip='.$_GET['zip']; 
    3939        array_push($page['infos'], sprintf(l10n('The archive is downloading, if the download doesn\'t start automatically please <a href="%s">click here</a>'), $set['U_DOWNLOAD'])); 
     40      } 
     41       
     42      if ($BatchDownloader->getParam('status') == 'new' and $BatchDownloader->getParam('nb_images') > 0) 
     43      { 
     44        $set['U_EDIT_SET'] = BATCH_DOWNLOAD_PUBLIC . 'view&amp;set_id='.$_GET['set_id']; 
    4045      } 
    4146       
     
    128133function batch_download_thumbnails_list_prefilter($content, &$smarty) 
    129134{ 
    130   // custom style 
    131   $search[0] = '{/html_style}'; 
    132   $replace[0] = '.thumbnails  .wrap1 {ldelim} position:relative; } 
    133 .removeSet {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:0.8em; } 
    134 .wrap1:hover .removeSet {ldelim} display:block; }' 
    135 .$search[0]; 
    136  
    137   // links 
    138   $search[1] = '<span class="wrap1">'; 
    139   $replace[1] = $search[1].' 
     135  // add links 
     136  $search = '<span class="wrap1">'; 
     137  $replace = $search.' 
    140138{strip}<a class="removeSet" href="{$U_VIEW}&amp;remove={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow"> 
    141139{\'Remove from download set\'|@translate}&nbsp;<img src="{$BATCH_DOWNLOAD_PATH}template/image_delete.png" title="{\'Remove from download set\'|@translate}"> 
    142140</a>{/strip}'; 
    143141 
    144   // AJAX request 
    145   $search[2] = '{/html_style}'; 
    146   $replace[2] = $search[2].' 
    147 {footer_script require=\'jquery\'} 
    148 jQuery(".removeSet").click(function() {ldelim} 
    149   var toggle_id = jQuery(this).data("id"); 
    150   var $trigger = jQuery(this); 
    151    
    152   jQuery.ajax({ldelim} 
    153     type: "POST", 
    154     url: "{$BATCH_DOWNLOAD_PATH}remove_image.php", 
    155     data: {ldelim} "set_id": "{$SET_ID}", "toggle_id": toggle_id } 
    156   }).done(function(msg) {ldelim} 
    157     if (msg == "false") {ldelim} 
    158       $trigger.parent(".wrap1").hide("fast", function() {ldelim} $trigger.remove() }); 
    159       jQuery(".nbImages").html(jQuery(".nbImages").html() -1); 
    160     } else {ldelim} 
    161       $trigger.html(\'{\'Un unknown error occured\'|@translate}\'); 
    162     } 
    163   }); 
    164    
    165   return false; 
    166 }); 
    167 {/footer_script}'; 
     142  // custom CSS and AJAX request 
     143  $content.= file_get_contents(BATCH_DOWNLOAD_PATH.'template/thumbnails_css_js.tpl'); 
    168144 
    169145  return str_replace($search, $replace, $content); 
  • extensions/BatchDownloader/template/init_zip.tpl

    r16609 r16626  
    11{combine_css path=$BATCH_DOWNLOAD_PATH|@cat:"template/style.css"} 
    2  
    3 {$MENUBAR} 
    42 
    53{if $set.U_DOWNLOAD} 
     
    97{/if} 
    108 
     9{if $themeconf.name != "stripped" and $themeconf.parent != "stripped" and $themeconf.name != "simple-grey" and $themeconf.parent != "simple"} 
     10  {$MENUBAR} 
     11{else} 
     12  {assign var="intern_menu" value="true"} 
     13{/if} 
    1114<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}"> 
     15{if $intern_menu}{$MENUBAR}{/if} 
     16 
    1217<div class="titrePage"> 
    1318  <ul class="categoryActions"></ul> 
  • extensions/BatchDownloader/template/view.tpl

    r16609 r16626  
    1 {$MENUBAR} 
     1{if $themeconf.name != "stripped" and $themeconf.parent != "stripped" and $themeconf.name != "simple-grey" and $themeconf.parent != "simple"} 
     2  {$MENUBAR} 
     3{else} 
     4  {assign var="intern_menu" value="true"} 
     5{/if} 
     6<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}"> 
     7{if $intern_menu}{$MENUBAR}{/if} 
    28 
    3 <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}"> 
    4 <div class="titrePage{if isset($chronology.TITLE)} calendarTitleBar{/if}"> 
     9<div class="titrePage"> 
    510  <ul class="categoryActions"></ul> 
    611  <h2>{$TITLE}</h2> 
     
    1116{/if} 
    1217 
    13 <p> 
     18{if $set} 
     19<fieldset> 
    1420  <h3>{$set.NAME}</h3> 
    1521  {if $set.COMMENT}<blockquote>{$set.COMMENT}</blockquote>{/if} 
    16   {'Nb images'|@translate}: <span class="nbImages">{$set.NB_IMAGES}</span> 
    17 </p> 
     22  {assign var="nb_images" value='<span class="nbImagesSet">'|@cat:$set.NB_IMAGES|@cat:'</span>'} 
     23  {'%d photos'|@translate|replace:'%d':'%s'|sprintf:$nb_images} 
     24</fieldset> 
    1825 
    1926 
     
    2229{$THUMBNAILS} 
    2330</ul> 
     31{else} 
     32{'This download set is empty'|@translate} 
    2433{/if} 
    2534 
     
    2736 
    2837<p style="text-align:center;font-weight:bold;margin:20px;"><a href="{$U_INIT_ZIP}" rel="nofollow">{'Return to download page'|@translate}</a></p> 
     38{/if} 
    2939 
    3040</div>{* <!-- content --> *} 
Note: See TracChangeset for help on using the changeset viewer.