From de750e1a8f453807e7950b71d2497bc6f9899209 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 15 Jan 2005 10:31:26 +0000 Subject: - 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 git-svn-id: http://piwigo.org/svn/trunk@691 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/update.php | 81 +++++++++++++++++++++++++++++++++------ template/default/admin/update.tpl | 75 +++++++++++++++++++----------------- 2 files changed, 108 insertions(+), 48 deletions(-) diff --git a/admin/update.php b/admin/update.php index 29cab4f87..c8ed1752a 100644 --- a/admin/update.php +++ b/admin/update.php @@ -247,8 +247,9 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_id $counts['del_categories'] = count($to_delete); } + echo ''."\n"; } // +-----------------------------------------------------------------------+ // | files / elements | @@ -260,8 +261,7 @@ if (isset($_POST['submit']) and $_POST['sync'] == 'files') $fs = get_fs($basedir); - echo get_elapsed_time($start, get_moment()); - echo ' for get_fs
'; + echo ''."\n"; $cat_ids = array_diff(array_keys($db_categories), $to_delete); @@ -450,8 +450,9 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id $counts['del_elements'] = count($to_delete_elements); } + echo ''."\n"; } // +-----------------------------------------------------------------------+ // | template initialization | @@ -468,6 +469,7 @@ $result_title.= $lang['update_part_research']; $template->assign_vars( array( 'L_SUBMIT'=>$lang['submit'], + 'L_RESET'=>$lang['reset'], 'L_UPDATE_TITLE'=>$lang['update_default_title'], 'L_UPDATE_SYNC_FILES'=>$lang['update_sync_files'], 'L_UPDATE_SYNC_DIRS'=>$lang['update_sync_dirs'], @@ -495,25 +497,73 @@ $template->assign_vars( // +-----------------------------------------------------------------------+ // | introduction : choices | // +-----------------------------------------------------------------------+ -if (!isset($_POST['submit'])) +if (!isset($_POST['submit']) or (isset($simulate) and $simulate)) { $template->assign_block_vars('introduction', array()); + if (isset($simulate) and $simulate) + { + switch ($_POST['sync']) + { + case 'dirs' : + { + $template->assign_vars( + array('SYNC_DIRS_CHECKED'=>'checked="checked"')); + break; + } + case 'files' : + { + $template->assign_vars( + array('SYNC_ALL_CHECKED'=>'checked="checked"')); + break; + } + } + + if (isset($_POST['display_info']) and $_POST['display_info'] == 1) + { + $template->assign_vars( + array('DISPLAY_INFO_CHECKED'=>'checked="checked"')); + } + + if (isset($_POST['subcats-included']) and $_POST['subcats-included'] == 1) + { + $template->assign_vars( + array('SUBCATS_INCLUDED_CHECKED'=>'checked="checked"')); + } + + if (isset($_POST['cat']) and is_numeric($_POST['cat'])) + { + $cat_selected = array($_POST['cat']); + } + else + { + $cat_selected = array(); + } + } + else + { + $template->assign_vars( + array('SYNC_DIRS_CHECKED' => 'checked="checked"', + 'SUBCATS_INCLUDED_CHECKED'=>'checked="checked"')); + + $cat_selected = array(); + } + $query = ' SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.' WHERE site_id = 1 ;'; display_select_cat_wrapper($query, - array(), + $cat_selected, 'introduction.category_option', false); } // +-----------------------------------------------------------------------+ // | synchronize files | // +-----------------------------------------------------------------------+ -else if (isset($_POST['submit']) - and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files')) +if (isset($_POST['submit']) + and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files')) { $template->assign_block_vars( 'update', @@ -558,13 +608,15 @@ else if (isset($_POST['submit']) { $start = get_moment(); update_category('all'); + echo ''."\n"; $start = get_moment(); ordering(); update_global_rank(); + echo ''."\n"; } } // +-----------------------------------------------------------------------+ @@ -597,11 +649,16 @@ else if (isset($_POST['submit']) and preg_match('/^metadata/', $_POST['sync'])) $files = get_filelist($opts['category_id'], $opts['recursive'], $opts['only_new']); - echo get_elapsed_time($start, get_moment()).' for get_filelist
'; + + echo ''."\n"; $start = get_moment(); update_metadata($files); - echo get_elapsed_time($start, get_moment()).' for metadata update
'; + echo ''."\n"; } // +-----------------------------------------------------------------------+ // | sending html code | diff --git a/template/default/admin/update.tpl b/template/default/admin/update.tpl index 1f5dbee2e..5b4136ca2 100644 --- a/template/default/admin/update.tpl +++ b/template/default/admin/update.tpl @@ -1,36 +1,3 @@ - -
{L_UPDATE_TITLE}
-
- -

-
-
{L_RESULT_UPDATE}