Changeset 5812


Ignore:
Timestamp:
Apr 12, 2010, 11:35:33 AM (10 years ago)
Author:
plg
Message:

feature 1600: the upload_mode is "remembered".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/photos_add_direct.php

    r5743 r5812  
    330330
    331331$upload_modes = array('html', 'multiple');
    332 
    333 $upload_mode = 'multiple';
    334 $upload_switch = 'html';
     332$upload_mode = isset($conf['upload_mode']) ? $conf['upload_mode'] : 'multiple';
     333
    335334if (isset($_GET['upload_mode']) and in_array($_GET['upload_mode'], $upload_modes))
    336335{
    337   $index_of_upload_mode = array_flip($upload_modes);
    338   $upload_mode_index = $index_of_upload_mode[ $_GET['upload_mode'] ];
    339 
    340336  $upload_mode = $_GET['upload_mode'];
    341   $upload_switch = $upload_modes[ ($upload_mode_index + 1) % 2 ];
    342 }
     337  conf_update_param('upload_mode', $upload_mode);
     338}
     339
     340// what is the upload switch mode
     341$index_of_upload_mode = array_flip($upload_modes);
     342$upload_mode_index = $index_of_upload_mode[$upload_mode];
     343$upload_switch = $upload_modes[ ($upload_mode_index + 1) % 2 ];
    343344
    344345$template->assign(
Note: See TracChangeset for help on using the changeset viewer.