Ignore:
Timestamp:
Feb 28, 2006, 2:13:16 AM (18 years ago)
Author:
rvelices
Message:

remake of Remote sites and synchronize: final integration and old code cleanup

fix: xml getAttribute always decodes html entities and added encodeAttribute
function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/site_update.php

    • Property svn:eol-style set to native
    r1033 r1058  
    5151
    5252$error_labels = array(
    53   'PWG-UPDATE-1' => array( l10n('update_wrong_dirname_short'), 
     53  'PWG-UPDATE-1' => array( l10n('update_wrong_dirname_short'),
    5454                           l10n('update_wrong_dirname_info') ),
    5555  'PWG-UPDATE-2' => array( l10n('update_missing_tn_short'),
    56                            l10n('update_missing_tn_info') 
     56                           l10n('update_missing_tn_info')
    5757                           . implode(',', $conf['picture_ext']) ),
    58   'PWG-ERROR-NO-FS' => array( l10n('Does not exist'),
     58  'PWG-ERROR-NO-FS' => array( l10n('update_missing_file_or_dir'),
    5959                             l10n('update_missing_file_or_dir_info')),
    60   'PWG-ERROR-VERSION' => array( l10n('Invalid PhpWebGalley version'),
    61                              l10n('update_pwg_version_differs_info')),
    62   'PWG-ERROR-NOLISTING' => array( l10n('remote_site_listing_not_found'),
    63                              l10n('remote_site_listing_not_found_info'))
     60  'PWG-ERROR-VERSION' => array( l10n('update_err_pwg_version_differs'),
     61                             l10n('update_err_pwg_version_differs_info')),
     62  'PWG-ERROR-NOLISTING' => array( l10n('update_err_remote_listing_not_found'),
     63                             l10n('update_err_remote_listing_not_found_info'))
    6464                      );
    6565$errors = array();
     
    409409        $insert{'date_available'} = CURRENT_DATE;
    410410        $insert{'tn_ext'} = $fs[$path]['tn_ext'];
    411         $insert{'has_high'} = $fs[$path]['has_high'];
     411        if ( isset($fs[$path]['has_high']) )
     412        {
     413          $insert{'has_high'} = $fs[$path]['has_high'];
     414        }
     415        else
     416        {
     417          $insert{'has_high'} = null;
     418        }
    412419        $insert{'path'} = $path;
    413420
     
    431438      $insert{'date_available'} = CURRENT_DATE;
    432439      $insert{'has_high'} = $fs[$path]['has_high'];
     440      if ( isset($fs[$path]['has_high']) )
     441      {
     442        $insert{'has_high'} = $fs[$path]['has_high'];
     443      }
     444      else
     445      {
     446        $insert{'has_high'} = null;
     447      }
    433448      $insert{'path'} = $path;
    434449
     
    525540      foreach ($fields['update'] as $field)
    526541      {
    527         $data[$field] = getAttribute($row['infos'], $field);
     542        $data[$field] = addslashes( getAttribute($row['infos'], $field) );
    528543      }
    529544
     
    582597// |                          synchronize metadata                         |
    583598// +-----------------------------------------------------------------------+
    584 if (isset($_POST['submit']) and preg_match('/^metadata/', $_POST['sync']) 
     599if (isset($_POST['submit']) and preg_match('/^metadata/', $_POST['sync'])
    585600         and !$general_failure)
    586601{
     
    643658    mass_updates(IMAGES_TABLE, $fields, $datas);
    644659  }
    645  
     660
    646661  echo '<!-- metadata update : ';
    647662  echo get_elapsed_time($start, get_moment());
     
    672687if ($site_is_remote and !isset($_POST['submit']) )
    673688{
    674   $used_metadata.= ' + ' . l10n('Aditionnal remote attributes');
     689  $used_metadata.= ' + ...';
    675690}
    676691
Note: See TracChangeset for help on using the changeset viewer.