Changeset 1033


Ignore:
Timestamp:
Feb 11, 2006, 8:36:09 PM (18 years ago)
Author:
rvelices
Message:

remake Remote Site/Synchro - bug on commentable + use l10n instead of get_lang

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/site_manager.php

    r1029 r1033  
    6464  else
    6565  {
    66     array_push($page['errors'], get_lang('remote_site_file_not_found'));
     66    array_push($page['errors'], l10n('remote_site_file_not_found'));
    6767  }
    6868}
     
    100100  {
    101101    array_push($page['errors'],
    102       get_lang('remote_site_already_exists').' ['.$url.']');
     102      l10n('remote_site_already_exists').' ['.$url.']');
    103103  }
    104104  if (count($page['errors']) == 0)
     
    115115        {
    116116          array_push($page['errors'],
    117                      get_lang('remote_site_error').' : '.$first_line);
     117                     l10n('remote_site_error').' : '.$first_line);
    118118        }
    119119      }
    120120      else
    121121      {
    122         array_push($page['errors'], get_lang('remote_site_file_not_found') );
     122        array_push($page['errors'], l10n('remote_site_file_not_found') );
    123123      }
    124124    }
     
    128128      {
    129129        array_push($page['errors'],
    130           get_lang('Directory does not exist').' ['.$url.']');
     130          l10n('Directory does not exist').' ['.$url.']');
    131131      }
    132132    }
     
    143143    pwg_query($query);
    144144    array_push($page['infos'],
    145                $url.' '.get_lang('remote_site_created'));
     145               $url.' '.l10n('remote_site_created'));
    146146  }
    147147}
     
    166166    case 'generate' :
    167167    {
    168       $title = $galleries_url.' : '.get_lang('remote_site_generate');
     168      $title = $galleries_url.' : '.l10n('remote_site_generate');
    169169      $template->assign_vars(array('REMOTE_SITE_TITLE'=>$title));
    170170      remote_output($galleries_url.'create_listing_file.php?action=generate');
     
    173173    case 'test' :
    174174    {
    175       $title = $galleries_url.' : '.get_lang('remote_site_test');
     175      $title = $galleries_url.' : '.l10n('remote_site_test');
    176176      $template->assign_vars(array('REMOTE_SITE_TITLE'=>$title));
    177177      remote_output($galleries_url.'create_listing_file.php?action=test&version='.PHPWG_VERSION);
     
    180180    case 'clean' :
    181181    {
    182       $title = $galleries_url.' : '.get_lang('remote_site_clean');
     182      $title = $galleries_url.' : '.l10n('remote_site_clean');
    183183      $template->assign_vars(array('REMOTE_SITE_TITLE'=>$title));
    184184      remote_output($galleries_url.'create_listing_file.php?action=clean');
     
    189189      delete_site($page['site']);
    190190      array_push($page['infos'],
    191                  $galleries_url.' '.get_lang('remote_site_deleted'));
     191                 $galleries_url.' '.l10n('remote_site_deleted'));
    192192      break;
    193193    }
     
    232232    array(
    233233      'NAME' => $row['galleries_url'],
    234       'TYPE' => get_lang( $is_remote ? 'Remote' : 'Local' ),
     234      'TYPE' => l10n( $is_remote ? 'Remote' : 'Local' ),
    235235      'CATEGORIES' => $row['nb_categories'],
    236236      'IMAGES' => isset($row['nb_images']) ? $row['nb_images'] : 0,
  • trunk/admin/site_update.php

    r1029 r1033  
    5151
    5252$error_labels = array(
    53   'PWG-UPDATE-1' => array( get_lang('update_wrong_dirname_short'),
    54                            get_lang('update_wrong_dirname_info') ),
    55   'PWG-UPDATE-2' => array( get_lang('update_missing_tn_short'),
    56                            get_lang('update_missing_tn_info')
     53  'PWG-UPDATE-1' => array( l10n('update_wrong_dirname_short'),
     54                           l10n('update_wrong_dirname_info') ),
     55  'PWG-UPDATE-2' => array( l10n('update_missing_tn_short'),
     56                           l10n('update_missing_tn_info')
    5757                           . implode(',', $conf['picture_ext']) ),
    58   'PWG-ERROR-NO-FS' => array( get_lang('Does not exist'),
    59                              get_lang('update_missing_file_or_dir_info')),
    60   'PWG-ERROR-VERSION' => array( get_lang('Invalid PhpWebGalley version'),
    61                              get_lang('update_pwg_version_differs_info')),
    62   'PWG-ERROR-NOLISTING' => array( get_lang('remote_site_listing_not_found'),
    63                              get_lang('remote_site_listing_not_found_info'))
     58  'PWG-ERROR-NO-FS' => array( l10n('Does not exist'),
     59                             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'))
    6464                      );
    6565$errors = array();
     
    227227      else
    228228      {
    229         $insert{'uploadable'} = false;
     229        $insert{'uploadable'} = 'false';
    230230      }
    231231      $insert{'status'} = $conf{'newcat_default_status'};
     
    260260      array_push($inserts, $insert);
    261261      array_push($infos, array('path' => $fulldir,
    262                                'info' => get_lang('update_research_added')));
     262                               'info' => l10n('update_research_added')));
    263263
    264264      // add the new category to $db_categories and $db_fulldirs array
     
    301301    unset($db_fulldirs[$fulldir]);
    302302    array_push($infos, array('path' => $fulldir,
    303                              'info' => get_lang('update_research_deleted')));
     303                             'info' => l10n('update_research_deleted')));
    304304  }
    305305  if (count($to_delete) > 0)
     
    417417                         'category_id' => $insert{'storage_category_id'}));
    418418        array_push($infos, array('path' => $insert{'path'},
    419                                  'info' => get_lang('update_research_added')));
     419                                 'info' => l10n('update_research_added')));
    420420      }
    421421      else
     
    447447                       'category_id' => $insert{'storage_category_id'}));
    448448      array_push($infos, array('path' => $insert{'path'},
    449                                'info' => get_lang('update_research_added')));
     449                               'info' => l10n('update_research_added')));
    450450    }
    451451  }
     
    475475    array_push($to_delete_elements, array_search($path, $db_elements));
    476476    array_push($infos, array('path' => $path,
    477                              'info' => get_lang('update_research_deleted')));
     477                             'info' => l10n('update_research_deleted')));
    478478  }
    479479  if (count($to_delete_elements) > 0)
     
    664664if (isset($simulate) and $simulate)
    665665{
    666   $result_title.= get_lang('update_simulation_title').' ';
     666  $result_title.= l10n('update_simulation_title').' ';
    667667}
    668668
     
    672672if ($site_is_remote and !isset($_POST['submit']) )
    673673{
    674   $used_metadata.= ' + ' . get_lang('Aditionnal remote attributes');
     674  $used_metadata.= ' + ' . l10n('Aditionnal remote attributes');
    675675}
    676676
     
    679679    'SITE_URL'=>$site_url,
    680680    'U_SITE_MANAGER'=> PHPWG_ROOT_PATH.'admin.php?page=site_manager',
    681     'L_RESULT_UPDATE'=>$result_title.get_lang('update_part_research'),
    682     'L_RESULT_METADATA'=>$result_title.get_lang('update_result_metadata'),
     681    'L_RESULT_UPDATE'=>$result_title.l10n('update_part_research'),
     682    'L_RESULT_METADATA'=>$result_title.l10n('update_result_metadata'),
    683683    'METADATA_LIST' => $used_metadata
    684684    ));
  • trunk/include/functions.inc.php

    r1029 r1033  
    431431function pwg_query($query)
    432432{
    433   global $conf,$page,$debug;
     433  global $conf,$page,$debug,$t2;
    434434 
    435435  $start = get_moment();
     
    456456    $output.= "\n".'(total SQL time  : ';
    457457    $output.= number_format($page['queries_time'], 3, '.', ' ').' s)';
     458    $output.= "\n".'(total time      : ';
     459    $output.= number_format( ($time+$start-$t2), 3, '.', ' ').' s)';
    458460    $output.= "</pre>\n";
    459461   
     
    466468function pwg_debug( $string )
    467469{
    468   global $debug,$t2,$count_queries;
     470  global $debug,$t2,$page;
    469471
    470472  $now = explode( ' ', microtime() );
     
    474476  $debug .= '<p>';
    475477  $debug.= '['.$time.', ';
    476   $debug.= $count_queries.' queries] : '.$string;
     478  $debug.= $page['count_queries'].' queries] : '.$string;
    477479  $debug.= "</p>\n";
    478480}
     
    975977
    976978/**
    977  * returns the $str in current language if possible or $str enclosed
    978  * in special chars
    979  */
    980 function get_lang($str)
    981 {
    982   global $lang;
    983   if ( isset($lang[$str]) )
    984   {
    985     return $lang[$str];
    986   }
    987   return '@@'.$str.'@@';
    988 }
    989 
    990 /**
    991979 * which upgrades are available ?
    992980 *
Note: See TracChangeset for help on using the changeset viewer.