Ignore:
Timestamp:
Jul 27, 2012, 4:44:19 PM (12 years ago)
Author:
mistic100
Message:

rewrite all urls to be compatible with "question_mark_in_urls"

Location:
extensions/BatchDownloader
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/admin.php

    r16689 r17177  
    33
    44global $template, $page, $conf;
     5
     6define('BATCH_DOWNLOAD_PUBLIC',  make_index_url(array('section' => 'download')) . '/');
    57
    68// tabsheet
  • extensions/BatchDownloader/admin/template/style.css

    r16697 r17177  
    4646  width:120px;
    4747}
    48 
    49 .ui-slider { background:#666;border-radius:2px;border:1px solid #888; }
    50 .ui-slider .ui-slider-handle { border:1px solid #ccc;background:#444;border-radius:0.6em; }
    51 .ui-slider .ui-slider-range { background:#888;border-radius:2px; }
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r16697 r17177  
    425425    }
    426426   
     427    $root_url = get_root_url();
     428   
    427429    $out = '';
    428430    for ($i=1; $i<=$this->data['nb_zip']; $i++)
     
    432434      if ($this->data['status'] == 'done' or $i < $this->data['last_zip']+1)
    433435      {
    434         $out.= '<img src="'.BATCH_DOWNLOAD_PATH.'template/drive.png"> Archive #'.$i.' (already downloaded)';
     436        $out.= '<img src="'.$root_url.BATCH_DOWNLOAD_PATH.'template/drive.png"> Archive #'.$i.' (already downloaded)';
    435437      }
    436438      else if ($i == $this->data['last_zip']+1)
     
    438440          $out.= '<a href="'.add_url_params($url, array('set_id'=>$this->data['id'],'zip'=>$i)).'" rel="nofollow" style="font-weight:bold;"'
    439441            .($i!=1 ? 'onClick="return confirm(\'Starting download Archive #'.$i.' will destroy Archive #'.($i-1).', be sure you finish the download. Continue ?\');"' : null).
    440             '><img src="'.BATCH_DOWNLOAD_PATH.'template/drive_go.png"> Archive #'.$i.' (ready)</a>';
     442            '><img src="'.$root_url.BATCH_DOWNLOAD_PATH.'template/drive_go.png"> Archive #'.$i.' (ready)</a>';
    441443      }
    442444      else
    443445      {
    444         $out.= '<img src="'.BATCH_DOWNLOAD_PATH.'template/drive.png"> Archive #'.$i.' (pending)';
     446        $out.= '<img src="'.$root_url.BATCH_DOWNLOAD_PATH.'template/drive.png"> Archive #'.$i.' (pending)';
    445447      }
    446448     
     
    609611          if (!class_exists('UserCollection')) throw new Exception();
    610612          $UserCollection = new UserCollection($this->data['type_id']);
    611           $set['NAME'] = l10n('Collection').': <a href="'.USER_COLLEC_PUBLIC.'view/'.$UserCollection->getParam('id').'">'.$UserCollection->getParam('name').'</a>';
     613          $infos = $UserCollection->getCollectionInfo();
     614          $set['NAME'] = l10n('Collection').': <a href="'.$infos['U_PUBLIC'].'">'.$UserCollection->getParam('name').'</a>';
    612615        }
    613616        catch (Exception $e)
  • extensions/BatchDownloader/include/download.inc.php

    r16626 r17177  
    2323        pwg_query('DELETE FROM '.BATCH_DOWNLOAD_TSETS.' WHERE id = '.$_GET['set_id'].';');
    2424        $_SESSION['page_infos'][] = l10n('Download set deleted');
    25         redirect('index.php');
     25        redirect(get_root_url());
    2626      }
    2727     
     
    3636      if (isset($next_file))
    3737      {
    38         $set['U_DOWNLOAD'] = BATCH_DOWNLOAD_PATH . 'download.php?set_id='.$_GET['set_id'].'&amp;zip='.$_GET['zip'];
     38        $set['U_DOWNLOAD'] = get_root_url().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']));
    4040      }
     
    4242      if ($BatchDownloader->getParam('status') == 'new' and $BatchDownloader->getParam('nb_images') > 0)
    4343      {
    44         $set['U_EDIT_SET'] = BATCH_DOWNLOAD_PUBLIC . 'view&amp;set_id='.$_GET['set_id'];
     44        $set['U_EDIT_SET'] = add_url_params(BATCH_DOWNLOAD_PUBLIC . 'view', array('set_id'=>$_GET['set_id']));
    4545      }
    4646     
     
    5555      }
    5656     
    57       $set['U_CANCEL'] = BATCH_DOWNLOAD_PUBLIC . 'init_zip&amp;set_id='.$_GET['set_id'].'&amp;cancel';
     57      $set['U_CANCEL'] = add_url_params(BATCH_DOWNLOAD_PUBLIC . 'init_zip', array('set_id'=>$_GET['set_id'], 'cancel'=>'true'));
    5858     
    5959      $template->assign(array(
     
    7373  case 'view':
    7474  {
    75     $self_url = BATCH_DOWNLOAD_PUBLIC . 'view&amp;set_id='.$_GET['set_id'];
     75    $self_url = add_url_params(BATCH_DOWNLOAD_PUBLIC . 'view', array('set_id'=>$_GET['set_id']));
    7676   
    7777    $template->set_filename('index', dirname(__FILE__).'/../template/view.tpl');
     
    7979      'BATCH_DOWNLOAD_PATH' => BATCH_DOWNLOAD_PATH,
    8080      'U_VIEW' => $self_url,
    81       'U_INIT_ZIP' => BATCH_DOWNLOAD_PUBLIC . 'init_zip&amp;set_id='.$_GET['set_id'],
     81      'U_INIT_ZIP' => add_url_params(BATCH_DOWNLOAD_PUBLIC . 'init_zip', array('set_id'=>$_GET['set_id'])),
    8282      'SET_ID' => $_GET['set_id'],
    8383      ));
     
    137137  $replace = $search.'
    138138{strip}<a class="removeSet" href="{$U_VIEW}&amp;remove={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
    139 {\'Remove from download set\'|@translate}&nbsp;<img src="{$BATCH_DOWNLOAD_PATH}template/image_delete.png" title="{\'Remove from download set\'|@translate}">
     139{\'Remove from download set\'|@translate}&nbsp;<img src="{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/image_delete.png" title="{\'Remove from download set\'|@translate}">
    140140</a>{/strip}';
    141141
  • extensions/BatchDownloader/include/events.inc.php

    r16697 r17177  
    1818{
    1919  global $tokens, $page, $conf;
     20 
     21  define('BATCH_DOWNLOAD_PUBLIC',  make_index_url(array('section' => 'download')) . '/');
    2022 
    2123  if ($tokens[0] == 'download')
     
    8183        $BatchDownloader->createNextArchive(true); // make sure we have only one zip, even if 'max_size' is exceeded
    8284       
    83         $u_download = BATCH_DOWNLOAD_PATH . 'download.php?set_id='.$BatchDownloader->getParam('id').'&amp;zip=1';
     85        $u_download = get_root_url().BATCH_DOWNLOAD_PATH . 'download.php?set_id='.$BatchDownloader->getParam('id').'&amp;zip=1';
    8486       
    8587        $null = null;
     
    9193      else
    9294      {
    93         redirect(BATCH_DOWNLOAD_PUBLIC . 'init_zip&amp;set_id='.$BatchDownloader->getParam('id'));
     95        redirect(add_url_params(BATCH_DOWNLOAD_PUBLIC . 'init_zip', array('set_id'=>$BatchDownloader->getParam('id'))));
    9496      }
    9597    }
     
    104106    $url = duplicate_index_url(array(), array('action'));
    105107  }
     108 
     109  $url = add_url_params($url, array('action'=>'advdown_set'));
    106110 
    107111  // toolbar button
    108112  $button = '<script type="text/javascript">var batchdown_count = '.count($page['items']).'; var batchdown_string = "'.l10n('Confirm the download of %d pictures?').'";</script>
    109     <li><a href="'. $url .'&amp;action=advdown_set" title="'.l10n('Download all pictures of this selection').'" class="pwg-state-default pwg-button" rel="nofollow"
     113    <li><a href="'. $url .'" title="'.l10n('Download all pictures of this selection').'" class="pwg-state-default pwg-button" rel="nofollow"
    110114    onClick="return confirm(batchdown_string.replace(\'%d\', batchdown_count));">
    111                         <span class="pwg-icon batch-downloader-icon" style="background:url(\'' . BATCH_DOWNLOAD_PATH . 'template/zip.png\') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">'.l10n('Batch Downloader').'</span>
     115                        <span class="pwg-icon batch-downloader-icon" style="background:url(\'' . get_root_url().BATCH_DOWNLOAD_PATH . 'template/zip.png\') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">'.l10n('Batch Downloader').'</span>
    112116                </a></li>';
    113117  $template->concat('PLUGIN_INDEX_ACTIONS', $button);
     
    165169     
    166170      array_push($data, array(
    167         'URL' => BATCH_DOWNLOAD_PUBLIC . 'init_zip&amp;set_id='.$BatchDownloader->getParam('id'),
     171        'URL' => add_url_params(BATCH_DOWNLOAD_PUBLIC . 'init_zip', array('set_id'=>$BatchDownloader->getParam('id'))),
    168172        'TITLE' => str_replace('"', "'", strip_tags($set['COMMENT'])),
    169173        'NAME' => $set['sNAME'],
  • extensions/BatchDownloader/main.inc.php

    r16598 r17177  
    1818define('BATCH_DOWNLOAD_LOCAL',   PHPWG_ROOT_PATH . $conf['data_location'] . 'download_archives/');
    1919define('BATCH_DOWNLOAD_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
    20 define('BATCH_DOWNLOAD_PUBLIC',  make_index_url(array('section' => 'download')) . '/');
    2120
    2221
  • extensions/BatchDownloader/template/thumbnails_css_js.tpl

    r16689 r17177  
    1212  jQuery.ajax({ldelim}
    1313    type: "POST",
    14     url: "{$BATCH_DOWNLOAD_PATH}remove_image.php",
     14    url: "{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}remove_image.php",
    1515    data: {ldelim} "set_id": "{$SET_ID}", "toggle_id": toggle_id }
    1616  }).done(function(msg) {ldelim}
Note: See TracChangeset for help on using the changeset viewer.