Changeset 691 for trunk/admin


Ignore:
Timestamp:
Jan 15, 2005, 11:31:26 AM (19 years ago)
Author:
plg
Message:
  • no debug output in synchronization process (replaced by HTML comments, information is still available)
  • when showing result of a simulation, also displays the form with values given for simulation. Admin can perform another simulation or uncheck the simulation option
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/update.php

    r675 r691  
    248248  }
    249249 
     250  echo '<!-- scanning dirs : ';
    250251  echo get_elapsed_time($start, get_moment());
    251   echo ' for new method scanning directories<br />';
     252  echo ' -->'."\n";
    252253}
    253254// +-----------------------------------------------------------------------+
     
    261262  $fs = get_fs($basedir);
    262263 
    263   echo get_elapsed_time($start, get_moment());
    264   echo ' for get_fs<br />';
     264  echo '<!-- get_fs : '.get_elapsed_time($start, get_moment()).' -->'."\n";
    265265 
    266266  $cat_ids = array_diff(array_keys($db_categories), $to_delete);
     
    451451  }
    452452 
     453  echo '<!-- scanning files : ';
    453454  echo get_elapsed_time($start_files, get_moment());
    454   echo ' for new method scanning files<br />';
     455  echo ' -->'."\n";
    455456}
    456457// +-----------------------------------------------------------------------+
     
    469470  array(
    470471    'L_SUBMIT'=>$lang['submit'],
     472    'L_RESET'=>$lang['reset'],
    471473    'L_UPDATE_TITLE'=>$lang['update_default_title'],
    472474    'L_UPDATE_SYNC_FILES'=>$lang['update_sync_files'],
     
    496498// |                        introduction : choices                         |
    497499// +-----------------------------------------------------------------------+
    498 if (!isset($_POST['submit']))
     500if (!isset($_POST['submit']) or (isset($simulate) and $simulate))
    499501{
    500502  $template->assign_block_vars('introduction', array());
     503
     504  if (isset($simulate) and $simulate)
     505  {
     506    switch ($_POST['sync'])
     507    {
     508      case 'dirs' :
     509      {
     510        $template->assign_vars(
     511          array('SYNC_DIRS_CHECKED'=>'checked="checked"'));
     512        break;
     513      }
     514      case 'files' :
     515      {
     516        $template->assign_vars(
     517          array('SYNC_ALL_CHECKED'=>'checked="checked"'));
     518        break;
     519      }
     520    }
     521
     522    if (isset($_POST['display_info']) and $_POST['display_info'] == 1)
     523    {
     524      $template->assign_vars(
     525        array('DISPLAY_INFO_CHECKED'=>'checked="checked"'));
     526    }
     527
     528    if (isset($_POST['subcats-included']) and $_POST['subcats-included'] == 1)
     529    {
     530      $template->assign_vars(
     531        array('SUBCATS_INCLUDED_CHECKED'=>'checked="checked"'));
     532    }
     533
     534    if (isset($_POST['cat']) and is_numeric($_POST['cat']))
     535    {
     536      $cat_selected = array($_POST['cat']);
     537    }
     538    else
     539    {
     540      $cat_selected = array();
     541    }
     542  }
     543  else
     544  {
     545    $template->assign_vars(
     546      array('SYNC_DIRS_CHECKED' => 'checked="checked"',
     547            'SUBCATS_INCLUDED_CHECKED'=>'checked="checked"'));
     548
     549    $cat_selected = array();
     550  }
    501551
    502552  $query = '
     
    506556;';
    507557  display_select_cat_wrapper($query,
    508                              array(),
     558                             $cat_selected,
    509559                             'introduction.category_option',
    510560                             false);
     
    513563// |                          synchronize files                            |
    514564// +-----------------------------------------------------------------------+
    515 else if (isset($_POST['submit'])
    516          and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files'))
     565if (isset($_POST['submit'])
     566    and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files'))
    517567{
    518568  $template->assign_block_vars(
     
    559609    $start = get_moment();
    560610    update_category('all');
     611    echo '<!-- update_category(all) : ';
    561612    echo get_elapsed_time($start,get_moment());
    562     echo ' for update_category(all)<br />';
     613    echo ' -->'."\n";
    563614    $start = get_moment();
    564615    ordering();
    565616    update_global_rank();
     617    echo '<!-- ordering categories : ';
    566618    echo get_elapsed_time($start, get_moment());
    567     echo ' for ordering categories<br />';
     619    echo ' -->'."\n";
    568620  }
    569621}
     
    598650                        $opts['recursive'],
    599651                        $opts['only_new']);
    600   echo get_elapsed_time($start, get_moment()).' for get_filelist<br />';
     652 
     653  echo '<!-- get_filelist : ';
     654  echo get_elapsed_time($start, get_moment());
     655  echo ' -->'."\n";
    601656 
    602657  $start = get_moment();
    603658  update_metadata($files);
    604   echo get_elapsed_time($start, get_moment()).' for metadata update<br />';
     659  echo '<!-- metadata update : ';
     660  echo get_elapsed_time($start, get_moment());
     661  echo ' -->'."\n";
    605662}
    606663// +-----------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.