Ignore:
Timestamp:
Jul 6, 2012, 1:03:39 PM (12 years ago)
Author:
mistic100
Message:
  • stylish download page
  • if there is only one archive, the file is downloaded directly
  • improve configuration page + add sliders (needs Piwigo 2.4.2)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r16379 r16392  
    260260   * createNextArchive
    261261   */
    262   function createNextArchive()
     262  function createNextArchive($force_one_archive=false)
    263263  {
    264264    // set already downloaded
     
    329329       
    330330        $total_size+= $row['filesize'];
    331         if ($total_size >= $this->conf['max_size']*1024) break;
     331        if ($total_size >= $this->conf['max_size']*1024 and !$force_one_archive) break;
    332332      }
    333333     
     
    358358      {
    359359        $this->updateParam('status', 'done');
     360        $this->clear(false);
    360361      }
    361362     
     
    417418    $nb_archives = $this->getEstimatedArchiveNumber();
    418419   
    419     $out = '<ul id="download_list">';
    420     if ($this->data['status'] == 'done')
     420    $out = '';
     421    /*if ($this->data['status'] == 'done')
    421422    {
    422423      $out.= '<li id="zip-1">Already downloaded</li>';
    423     }
    424     else
     424    }*/
     425    if (true)
    425426    {
    426427      for ($i=1; $i<=$this->data['nb_zip']; $i++)
     
    430431        if ($i < $this->data['last_zip']+1)
    431432        {
    432           $out.= 'Archive #'.$i.' (already downloaded)';
     433          $out.= '<img src="'.BATCH_DOWNLOAD_PATH.'template/drive.png"> Archive #'.$i.' (already downloaded)';
    433434        }
    434435        else if ($i == $this->data['last_zip']+1)
    435436        {
    436             $out.= '<a href="'.add_url_params($url, array('set_id'=>$this->data['set_id'],'zip'=>$i)).'" rel="nofollow"'
     437            $out.= '<a href="'.add_url_params($url, array('set_id'=>$this->data['set_id'],'zip'=>$i)).'" rel="nofollow" style="font-weight:bold;"'
    437438              .($i!=1 ? 'onClick="return confirm(\'Starting download Archive #'.$i.' will destroy Archive #'.($i-1).', be sure you finish the download. Continue ?\');"' : null).
    438               '>Archive #'.$i.' (ready)</a>';
     439              '><img src="'.BATCH_DOWNLOAD_PATH.'template/drive_go.png"> Archive #'.$i.' (ready)</a>';
    439440        }
    440441        else
    441442        {
    442           $out.= 'Archive #'.$i.' (pending)';
     443          $out.= '<img src="'.BATCH_DOWNLOAD_PATH.'template/drive.png"> Archive #'.$i.' (pending)';
    443444        }
    444445       
     
    446447      }
    447448    }
    448     $out.= '</ul>';
    449449   
    450450    return $out;
     
    472472          $this->data['type'] .'-'. $this->data['type_id'] .'_'.
    473473          $this->data['user_id'] . $this->data['set_id'] .'_'.
    474           'part'. $i .'.zip';
     474          ($this->data['nb_zip']!=1 ? 'part'. $i : null).
     475          '.zip';
    475476  }
    476477 
     
    505506      {
    506507        $category = get_cat_info($this->data['type_id']);
    507         $set['NAME'] = get_cat_display_name($category['upper_names']);
    508         $set['sNAME'] = $category['name'];
    509         $set['COMMENT'] = trigger_action('render_category_description', $category['comment']);
     508        $set['NAME'] = l10n('Album').': '.get_cat_display_name($category['upper_names']);
     509        $set['sNAME'] = l10n('Album').': '.trigger_event('render_category_name', $category['name']);
     510        $set['COMMENT'] = trigger_event('render_category_description', $category['comment']);
    510511        break;
    511512      }
     
    532533            .'</a>';
    533534        }
     535       
     536        $set['sNAME'] = l10n('Tags').': '.strip_tags($set['COMMENT']);
    534537        break;
    535538      }
Note: See TracChangeset for help on using the changeset viewer.