b2evolution PHP Cross Reference Blogging Systems

Source: /inc/locales/_locale_settings.form.php - 433 lines - 20072 bytes - Text - Print

Description: This file implements the UI view for the regional settings. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for the regional settings.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  10   *
  11   * {@internal License choice
  12   * - If you have received this file as part of a package, please find the license.txt file in
  13   *   the same folder or the closest folder above for complete license terms.
  14   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  15   *   then you must choose one of the following licenses before using the file:
  16   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  17   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  18   * }}
  19   *
  20   * {@internal Open Source relicensing agreement:
  21   * Daniel HAHLER grants Francois PLANQUE the right to license
  22   * Daniel HAHLER's contributions to this file and the b2evolution project
  23   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  24   * }}
  25   *
  26   * @package admin
  27   *
  28   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  29   * @author fplanque: Francois PLANQUE.
  30   * @author blueyed: Daniel HAHLER.
  31   *
  32   * @version $Id: _locale_settings.form.php 6664 2014-05-12 12:23:58Z yura $
  33   */
  34  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  35  
  36  
  37  /**
  38   * @var User
  39   */
  40  global $current_User;
  41  /**
  42   * @var GeneralSettings
  43   */
  44  global $Settings;
  45  
  46  global $rsc_subdir, $conf_subdir, $pagenow, $locales_path, $locales, $action, $edit_locale, $loc_transinfo, $template, $allow_po_extraction;
  47  global $localtimenow;
  48  
  49  
  50  if( $action == 'edit' )
  51  { // Edit a locale:
  52      $Form = new Form( NULL, 'loc_checkchanges', 'post', 'compact' );
  53  
  54      $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action,template' ) );
  55  
  56      $Form->begin_form( 'fform', T_('Locale settings').get_manual_link('locale-form') );
  57  
  58      $Form->add_crumb( 'locales' );
  59      $Form->hidden( 'ctrl', 'locales' );
  60      $Form->hidden( 'loc_transinfo', $loc_transinfo );
  61      $Form->hidden( 'action', ( $edit_locale == '_new_' ) ? 'createlocale' : 'updatelocale' );
  62      $Form->hidden( 'template', param( 'template', 'string', '' ) );
  63      $Form->hidden( 'edit_locale', $edit_locale );
  64  
  65      // read template
  66      if( isset( $locales[ $template ] ) )
  67      { // An editing of existing locale
  68          $ltemplate = $locales[ $template ];
  69          $newlocale = $template;
  70      }
  71      elseif( $edit_locale != '_new_' && isset( $locales[ $edit_locale ] ) )
  72      { // A creating of new locale that exists in $locales array
  73          $ltemplate = $locales[ $edit_locale ];
  74          $newlocale = $edit_locale;
  75      }
  76      else
  77      { // New unknown locale
  78          $newlocale = get_param( 'newloc_locale' );
  79      }
  80  
  81      if( isset( $ltemplate ) )
  82      { // Set properly values when errors exist after form was submitted
  83          $newlocale = get_param( 'newloc_locale' ) != '' ? get_param( 'newloc_locale' ) : $newlocale;
  84          foreach( $ltemplate as $lt_key => $lt_value )
  85          {
  86              if( get_param( 'newloc_'.$lt_key ) != '' )
  87              { // Display what user has entered on previous form instead of what saved in DB
  88                  $ltemplate[ $lt_key ] = get_param( 'newloc_'.$lt_key );
  89              }
  90          }
  91      }
  92  
  93      if( $edit_locale != '_new_' )
  94      { // we need to remember this for updating locale
  95          $Form->hidden( 'oldloc_locale', $newlocale );
  96      }
  97      $Form->hidden( 'newloc_transliteration_map', ( isset( $ltemplate['transliteration_map'] ) ? base64_encode( serialize( $ltemplate['transliteration_map'] ) ) : '' ) );
  98  
  99      // Locale
 100      $Form->text_input( 'newloc_locale', $newlocale, 20, T_('Locale'), sprintf( T_('The first two letters should be a <a %s>ISO 639 language code</a>. The last two letters should be a <a %s>ISO 3166 country code</a>.'),
 101          'href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_15.html#Language-Codes"',
 102          'href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_15.html#Country-Codes"' ),
 103          array( 'required' => true ) );
 104      // Enabled
 105      $Form->checkbox( 'newloc_enabled', ( isset( $ltemplate['enabled'] ) && $ltemplate['enabled'] ? 1 : get_param( 'newloc_enabled' ) ),
 106          T_('Enabled'), T_('Should this locale be available to users?') );
 107      // Name
 108      $Form->text_input( 'newloc_name', ( isset( $ltemplate['name'] ) ? $ltemplate['name'] : get_param( 'newloc_name' ) ), 40,
 109          T_('Name'), T_('name of the locale') );
 110      // Charset
 111      $Form->text_input( 'newloc_charset', ( isset( $ltemplate['charset'] ) ? $ltemplate['charset'] : get_param( 'newloc_charset' ) ), 20,
 112          T_('Charset'), T_('Must match the lang file charset.'), array( 'required' => true, 'maxlength' => 15 ) );
 113      // Date format
 114      $Form->text_input( 'newloc_datefmt', ( isset( $ltemplate['datefmt'] ) ? $ltemplate['datefmt'] : get_param( 'newloc_datefmt' ) ), 20,
 115          T_('Date format'), T_('See below.'), array( 'required' => true ) );
 116      // Time format
 117      $Form->text_input( 'newloc_timefmt', ( isset( $ltemplate['timefmt'] ) ? $ltemplate['timefmt'] : get_param( 'newloc_timefmt' ) ), 20,
 118          T_('Time format'), T_('See below.'), array( 'required' => true ) );
 119      // Start of week
 120      $Form->dayOfWeek( 'newloc_startofweek', ( isset( $ltemplate['startofweek'] ) ? $ltemplate['startofweek'] : get_param( 'newloc_startofweek' ) ),
 121          T_('Start of week'), T_('Day at the start of the week.') );
 122      // Lang file
 123      $Form->text( 'newloc_messages', ( isset( $ltemplate['messages'] ) ? $ltemplate['messages'] : get_param( 'newloc_messages' ) ), 20,
 124          T_('Lang file'), T_('the lang file to use, from the <code>locales</code> subdirectory') );
 125      // Priority
 126      $Form->text_input( 'newloc_priority', ( isset( $ltemplate['priority'] ) ? $ltemplate['priority'] : get_param( 'newloc_priority' ) ), 3,
 127          T_('Priority'), T_('1 is highest. Priority is important when selecting a locale from a language code and several locales match the same language; this can happen when detecting browser language. Priority also affects the order in which locales are displayed in dropdown boxes, etc.'),
 128          array( 'required' => true ) );
 129  
 130      // TODO: Update this field onchange of datefmt/timefmt through AJAX:
 131      // fp> It would actually make more sense to have the preview at the exact place that says "see below"
 132      locale_temp_switch( $newlocale );
 133      $Form->info_field( T_('Date preview'), date_i18n( locale_datefmt().' '.locale_timefmt(), $localtimenow ) );
 134      locale_restore_previous();
 135  
 136      // generate Javascript array of locales to warn in case of overwriting
 137      $l_warnfor = "'".implode("', '", array_keys($locales))."'";
 138      if( $edit_locale != '_new_' )
 139      { // remove the locale we want to edit from the generated array
 140          $l_warnfor = str_replace("'$newlocale'", "'thiswillneverevermatch'", $l_warnfor);
 141      }
 142  
 143      $Form->end_form( array( array( 'submit', 'submit', ($edit_locale == '_new_') ? T_('Create') : T_('Update'), 'SaveButton' ),
 144                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 145  
 146      ?>
 147      <div class="panelinfo">
 148          <h3><?php echo T_('Flags') ?></h3>
 149          <p><?php printf(T_('The flags are stored in the file <code>%s</code>. The config for background-position is located in the file %s and defined by array $country_flags_bg.'), '/'.$rsc_subdir.'icons/flags_sprite.png', '/'.$conf_subdir.'_locales.php'); ?></p>
 150          <h3><?php echo T_('Date/Time Formats') ?></h3>
 151          <p><?php echo T_('The following characters are recognized in the format strings:') ?></p>
 152          <p>
 153          <?php echo T_('a - "am" or "pm"') ?><br />
 154          <?php echo T_('A - "AM" or "PM"') ?><br />
 155          <?php echo T_('B - Swatch Internet time') ?><br />
 156          <?php echo T_('c - ISO 8601 date (Requires PHP 5); i.e. "2004-02-12T15:19:21+00:00"') ?><br />
 157          <?php echo T_('d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"') ?><br />
 158          <?php echo T_('D - day of the week, textual, 3 letters; i.e. "Fri"') ?><br />
 159          <?php echo T_('e - day of the week, 1 letter; i.e. "F"') ?><br />
 160          <?php echo T_('F - month, textual, long; i.e. "January"') ?><br />
 161          <?php echo T_('g - hour, 12-hour format without leading zeros; i.e. "1" to "12"') ?><br />
 162          <?php echo T_('G - hour, 24-hour format without leading zeros; i.e. "0" to "23"') ?><br />
 163          <?php echo T_('h - hour, 12-hour format; i.e. "01" to "12"') ?><br />
 164          <?php echo T_('H - hour, 24-hour format; i.e. "00" to "23"') ?><br />
 165          <?php echo T_('i - minutes; i.e. "00" to "59"') ?><br />
 166          <?php echo T_('I (capital i) - "1" if Daylight Savings Time, "0" otherwise.') ?><br />
 167          <?php echo T_('j - day of the month without leading zeros; i.e. "1" to "31"') ?><br />
 168          <?php echo T_('l (lowercase "L") - day of the week, textual, long; i.e. "Friday"') ?><br />
 169          <?php echo T_('L - boolean for whether it is a leap year; i.e. "0" or "1"') ?><br />
 170          <?php echo T_('m - month; i.e. "01" to "12"') ?><br />
 171          <?php echo T_('M - month, textual, 3 letters; i.e. "Jan"') ?><br />
 172          <?php echo T_('n - month without leading zeros; i.e. "1" to "12"') ?><br />
 173          <?php echo T_('O - Difference to Greenwich time (GMT) in hours; i.e. "+0200"') ?><br />
 174          <?php echo T_('r - RFC 822 formatted date; i.e. "Thu, 21 Dec 2000 16:01:07 +0200"') ?><br />
 175          <?php echo T_('s - seconds; i.e. "00" to "59"') ?><br />
 176          <?php echo T_('S - English ordinal suffix, textual, 2 characters; i.e. "th", "nd"') ?><br />
 177          <?php echo T_('t - number of days in the given month; i.e. "28" to "31"') ?><br />
 178          <?php echo T_('T - Timezone setting of this machine; i.e. "MDT"') ?><br />
 179          <?php echo T_('U - seconds since the epoch') ?><br />
 180          <?php echo T_('w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)') ?><br />
 181          <?php echo T_('W - ISO-8601 week number of year, weeks starting on Monday; i.e. "42"') ?><br />
 182          <?php echo T_('Y - year, 4 digits; i.e. "1999"') ?><br />
 183          <?php echo T_('y - year, 2 digits; i.e. "99"') ?><br />
 184          <?php echo T_('z - day of the year; i.e. "0" to "365"') ?><br />
 185          <?php echo T_('Z - timezone offset in seconds (i.e. "-43200" to "43200"). The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.') ?>
 186          </p>
 187          <?php echo T_('isoZ - full ISO 8601 format, equivalent to Y-m-d\TH:i:s\Z') ?><br />
 188          <p><?php echo T_('Unrecognized characters in the format string will be printed as-is.<br />
 189          You can escape characters by preceding them with a \ to print them as-is.') ?></p>
 190      </div>
 191  <?php
 192  }
 193  else
 194  { // show main form
 195  
 196      $Form = new Form( $pagenow, 'loc_checkchanges' );
 197  
 198      $Form->begin_form( 'fform' );
 199  
 200      $Form->add_crumb( 'locales' );
 201      $Form->hidden( 'ctrl', 'locales' );
 202      $Form->hidden( 'action', 'update' );
 203      $Form->hidden( 'loc_transinfo', $loc_transinfo );
 204  
 205      $Form->begin_fieldset( T_('Regional settings').get_manual_link('locales-tab') );
 206  
 207      if( ! isset($locales[$Settings->get('default_locale')])
 208          || ! $locales[$Settings->get('default_locale')]['enabled'] )
 209      { // default locale is not enabled
 210          param_error( 'newdefault_locale', T_('Note: default locale is not enabled.') );
 211      }
 212  
 213      $locale_options = locale_options( $Settings->get('default_locale'), false );
 214      $Form->select_input_options( 'newdefault_locale', $locale_options, T_('Default locale'), T_('Overridden by browser config, user locale or blog locale (in this order).') );
 215      // $Form->select( 'newdefault_locale', $Settings->get('default_locale'), 'locale_options_return', T_('Default locale'), T_('Overridden by browser config, user locale or blog locale (in this order).'));
 216      $Form->end_fieldset();
 217  
 218  
 219      $Form->begin_fieldset( T_('Available locales').get_manual_link('locales-tab') );
 220  
 221      echo '<p class="center">';
 222      if( $loc_transinfo )
 223      {
 224          global $messages_pot_file_info;
 225          $messages_pot_file_info = locale_file_po_info( $locales_path.'messages.pot' );
 226  
 227          echo '<a href="'.$pagenow.'?ctrl=locales">' . T_('Hide translation info'), '</a><br />';
 228          echo sprintf( T_('Number of strings in .POT file: %s'), $messages_pot_file_info['all'] ).'<br />';
 229          if( $current_User->check_perm( 'options', 'edit' ) && !$allow_po_extraction )
 230          {
 231              echo '<span class="notes">';
 232              echo T_('To allow the extraction of language files, please set $allow_po_extraction = 1; in conf/_locales.php.');
 233              echo '</span>';
 234          }
 235      }
 236      else
 237      {
 238          echo '<a href="'.$pagenow.'?ctrl=locales&amp;loc_transinfo=1">' . T_('Show translation info'), '</a>';
 239      }
 240      echo '</p>';
 241  
 242      echo '<table class="grouped" cellspacing="0">';
 243  
 244      ?>
 245      <tr>
 246          <th class="firstcol"><?php echo T_('Locale') ?></th>
 247          <th><?php echo T_('Enabled') ?></th>
 248          <th><?php echo T_('Name') ?></th>
 249          <th><?php echo T_('Date fmt') ?></th>
 250          <th><?php echo T_('Time fmt') ?></th>
 251          <th title="<?php echo T_('Day at the start of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, etc');
 252              ?>"><?php echo T_('Start of week') ?></th>
 253          <th><?php echo T_('Priority') ?></th>
 254          <?php if( $current_User->check_perm( 'options', 'edit' ) )
 255          { ?>
 256              <th><?php echo T_('Edit') ?></th>
 257              <?php
 258          }
 259          if( $loc_transinfo )
 260          {
 261              ?>
 262              <th><?php echo T_('Strings') ?></th>
 263              <th><?php echo T_('Translated') ?></th>
 264              <?php
 265              if( $current_User->check_perm( 'options', 'edit' ) && $allow_po_extraction )
 266              {
 267                  echo '<th class="lastcol">'.T_('Extract').'</th>';
 268              }
 269          } ?>
 270      </tr>
 271  
 272  
 273      <?php
 274      $i = 0; // counter to distinguish POSTed locales later
 275      foreach( $locales as $lkey => $lval )
 276      {
 277          $i++;
 278  
 279          // Generate preview of date/time-format:
 280          locale_temp_switch($lkey);
 281          $datefmt_preview = date_i18n( $locales[$lkey]['datefmt'], $localtimenow );
 282          $timefmt_preview = date_i18n( $locales[$lkey]['timefmt'], $localtimenow );
 283          locale_restore_previous();
 284  
 285          ?>
 286          <tr class="<?php echo (($i%2 == 1) ? 'odd' : 'even') ?>">
 287          <td class="firstcol left" title="<?php echo T_('Priority').': '.$locales[$lkey]['priority'].', '.T_('Charset').': '.$locales[$lkey]['charset'].', '.T_('Lang file').': '.$locales[$lkey]['messages'] ?>">
 288              <?php
 289              echo '<input type="hidden" name="loc_'.$i.'_locale" value="'.$lkey.'" />';
 290  
 291              $transliteration_map = '';
 292              if( isset($locales[$lkey]['transliteration_map']) && is_array($locales[$lkey]['transliteration_map']) )
 293              {
 294                  $transliteration_map = base64_encode(serialize($locales[$lkey]['transliteration_map']));
 295              }
 296              echo '<input type="hidden" name="loc_'.$i.'_transliteration_map" value="'.$transliteration_map.'" />';
 297  
 298              locale_flag( $lkey );
 299              echo'
 300              <strong>';
 301              if( $current_User->check_perm( 'options', 'edit' ) )
 302              {
 303                  echo '<a href="'.$pagenow.'?ctrl=locales&amp;action=edit&amp;edit_locale='.$lkey.($loc_transinfo ? '&amp;loc_transinfo=1' : '').'" title="'.T_('Edit locale').'">';
 304              }
 305              echo $lkey;
 306              if( $current_User->check_perm( 'options', 'edit' ) )
 307              {
 308                  echo '</a>';
 309              }
 310  
 311              // TODO: Update title attribs for datefmt/timefmt onchange through AJAX  -- fp> all that complexity for an invisible tooltip... :/ Users should update the format on the detailed screen and get a dynamic preview there. Maybe the date and time should be editable on the list at all. There is no help here either. Users should be encouraged to go to the detailed screen )
 312              echo '</strong></td>
 313                  <td class="center">
 314                      <input type="checkbox" name="loc_'.$i.'_enabled" value="1"'. ( $locales[$lkey]['enabled'] ? 'checked="checked"' : '' ).' />
 315                  </td>
 316                  <td>
 317                      <input type="text" name="loc_'.$i.'_name" value="'.format_to_output( $locales[$lkey]['name'], 'formvalue' ).'" maxlength="40" size="17" />
 318                  </td>
 319                  <td>
 320                      <input type="text" name="loc_'.$i.'_datefmt" value="'.format_to_output( $locales[$lkey]['datefmt'], 'formvalue' ).'" maxlength="20" size="6" title="'.format_to_output( sprintf( T_('Preview: %s'), $datefmt_preview ), 'formvalue' ).'" />
 321                  </td>
 322                  <td>
 323                      <input type="text" name="loc_'.$i.'_timefmt" value="'.format_to_output( $locales[$lkey]['timefmt'], 'formvalue' ).'" maxlength="20" size="6" title="'.format_to_output( sprintf( T_('Preview: %s'), $timefmt_preview ), 'formvalue' ).'" />
 324                  </td>
 325                  <td>';
 326              $Form->switch_layout( 'none' );
 327              $Form->dayOfWeek( 'loc_'.$i.'_startofweek', $locales[$lkey]['startofweek'], '', '' );
 328              $Form->switch_layout( NULL ); // Restore layout
 329              echo '</td>';
 330  
 331          echo '<td class="right">'.$locales[$lkey]['priority'].'</td>';
 332  
 333  
 334          if( $current_User->check_perm( 'options', 'edit' ) )
 335          {
 336              if( $loc_transinfo )
 337              {
 338                  echo '<td class="shrinkwrap">';
 339              }
 340              else
 341              {
 342                  echo '<td class="lastcol shrinkwrap">';
 343              }
 344              if( $i > 1 )
 345              { // show "move prio up"
 346                  echo action_icon( T_('Move priority up'), 'move_up', '?ctrl=locales&amp;action=prioup&amp;edit_locale='
 347                                  .$lkey.($loc_transinfo ? '&amp;loc_transinfo=1' : '').'&amp;'.url_crumb('locales') );
 348              }
 349              else
 350              {
 351                  echo get_icon( 'nomove' ).' ';
 352              }
 353  
 354              if( $i < count($locales) )
 355              { // show "move prio down"
 356                  echo action_icon( T_('Move priority down'), 'move_down', '?ctrl=locales&amp;action=priodown&amp;edit_locale='
 357                                  .$lkey.($loc_transinfo ? '&amp;loc_transinfo=1' : '').'&amp;'.url_crumb('locales') );
 358              }
 359              else
 360              {
 361                  echo get_icon( 'nomove' ).' ';
 362              }
 363  
 364              echo action_icon( T_('Copy locale'), 'copy', '?ctrl=locales&amp;action=edit&amp;edit_locale=_new_&amp;template='.$lkey.($loc_transinfo ? '&amp;loc_transinfo=1' : '' ) );
 365  
 366              echo action_icon( T_('Edit locale'), 'edit', '?ctrl=locales&amp;action=edit&amp;edit_locale=_edit_&amp;template='.$lkey.($loc_transinfo ? '&amp;loc_transinfo=1' : '' ) );
 367  
 368              if( isset($lval[ 'fromdb' ]) )
 369              { // allow to delete locales loaded from db
 370                  $l_atleastonefromdb = 1;
 371                  echo action_icon( T_('Restore default locale settings'), 'reload', '?ctrl=locales&amp;action=resetlocale&amp;edit_locale='
 372                                  .$lkey.($loc_transinfo ? '&amp;loc_transinfo=1' : '' ).'&amp;'.url_crumb('locales') );
 373              }
 374              echo '</td>';
 375          }
 376  
 377          if( $loc_transinfo )
 378          {    // Show translation info:
 379              // Get PO file for that locale:
 380              $po_file = $locales_path.$locales[$lkey]['messages'].'/LC_MESSAGES/messages.po';
 381              if( ! is_file( $po_file ) )
 382              {
 383                  echo '<td class="lastcol center" colspan="'.(2 + (int)($current_User->check_perm( 'options', 'edit' ) && $allow_po_extraction)).'"><a href="?ctrl=translation&edit_locale='.$lkey.'">'.T_('No language file...').'</a></td>';
 384              }
 385              else
 386              {    // File exists:
 387                  $po_file_info = locale_file_po_info( $po_file, true );
 388  
 389                  // $all=$translated+$fuzzy+$untranslated;
 390                  echo "\n\t".'<td class="center">'.$po_file_info['all'].'</td>';
 391  
 392                  $percent_done = $po_file_info['percent'];
 393                  $color = sprintf( '%02x%02x00', 255 - round( $percent_done * 2.55 ), round( $percent_done * 2.55 ) );
 394                  echo "\n\t<td class=\"center\" style=\"background-color:#". $color . "\"><a href=\"?ctrl=translation&edit_locale=".$lkey."\">". $percent_done ." %</a></td>";
 395  
 396              }
 397  
 398              if( $current_User->check_perm( 'options', 'edit' ) && $allow_po_extraction  )
 399              { // Translator options:
 400                  if( is_file( $po_file ) )
 401                  {
 402                      echo "\n\t".'<td class="lastcol">[<a href="'.$pagenow.'?ctrl=locales&amp;action=extract&amp;edit_locale='.$lkey
 403                      .($loc_transinfo ? '&amp;loc_transinfo=1' : '').'&amp;'.url_crumb('locales').'" title="'.T_('Extract .po file into b2evo-format').'">'.T_('Extract').'</a>]</td>';
 404                  }
 405              }
 406          } // show message file percentage/extraction
 407  
 408          echo '</tr>';
 409      }
 410  
 411      echo '</table>';
 412  
 413      if( $current_User->check_perm( 'options', 'edit' ) )
 414      {
 415          echo '<p class="center"><a href="'.$pagenow.'?ctrl=locales&amp;action=edit'.( $loc_transinfo ? '&amp;loc_transinfo=1' : '' ).'&amp;edit_locale=_new_">'.get_icon( 'new' ).' '.T_('Create new locale').'</a></p>';
 416  
 417          if( isset($l_atleastonefromdb) )
 418          {
 419              echo '<p class="center"><a href="'.$pagenow.'?ctrl=locales&amp;action=reset'.( $loc_transinfo ? '&amp;loc_transinfo=1' : '' )
 420                          .'&amp;'.url_crumb('locales').'" onclick="return confirm(\''.TS_('Are you sure you want to restore to default locales?\nAll custom locale definitions will be lost!').'\')">'.get_icon( 'reload' ).' '.T_('Restore defaults').'</a></p>';
 421          }
 422      }
 423  
 424      $Form->end_fieldset();
 425  
 426      if( $current_User->check_perm( 'options', 'edit' ) )
 427      {
 428          $Form->end_form( array( array( 'submit', '', T_('Save !'), 'SaveButton' ),
 429                                                          array( 'reset', '', T_('Reset'), 'ResetButton' ) ) ) ;
 430      }
 431  }
 432  
 433  ?>

title

Description

title

Description

title

Description

title

title

Body