Changeset 6629 for trunk/admin


Ignore:
Timestamp:
Jun 29, 2010, 10:18:10 PM (14 years ago)
Author:
plg
Message:

merge r6628 from branch 2.1 to trunk

improvement: ability to hide setup warnings for upload. Warnings will
automatically come back at next user session.

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/photos_add_direct.php

    r6625 r6629  
    488488
    489489// +-----------------------------------------------------------------------+
    490 // |                             setup errors                              |
    491 // +-----------------------------------------------------------------------+
    492 
     490// |                         setup errors/warnings                         |
     491// +-----------------------------------------------------------------------+
     492
     493// Errors
    493494$setup_errors = array();
    494 $setup_warnings = array();
    495495
    496496$error_message = ready_for_upload_message();
     
    505505}
    506506
    507 if ($conf['use_exif'] and !function_exists('read_exif_data'))
    508 {
    509   array_push(
    510     $setup_warnings,
    511     l10n('Exif extension not available, admin should disable exif use')
    512     );
    513 }
    514 
    515 if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size'))
    516 {
    517   array_push(
    518     $setup_warnings,
    519     sprintf(
    520       l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'),
    521       get_ini_size('upload_max_filesize', false),
    522       get_ini_size('post_max_size', false)
     507$template->assign(
     508  array(
     509    'setup_errors'=> $setup_errors,
     510    )
     511  );
     512
     513// Warnings
     514if (isset($_GET['hide_warnings']))
     515{
     516  $_SESSION['upload_hide_warnings'] = true;
     517}
     518
     519if (!isset($_SESSION['upload_hide_warnings']))
     520{
     521  $setup_warnings = array();
     522 
     523  if ($conf['use_exif'] and !function_exists('read_exif_data'))
     524  {
     525    array_push(
     526      $setup_warnings,
     527      l10n('Exif extension not available, admin should disable exif use')
     528      );
     529  }
     530
     531  if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size'))
     532  {
     533    array_push(
     534      $setup_warnings,
     535      sprintf(
     536        l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'),
     537        get_ini_size('upload_max_filesize', false),
     538        get_ini_size('post_max_size', false)
     539        )
     540      );
     541  }
     542
     543  $template->assign(
     544    array(
     545      'setup_warnings' => $setup_warnings,
     546      'hide_warnings_link' => PHOTOS_ADD_BASE_URL.'&upload_mode='.$upload_mode.'&hide_warnings=1'
    523547      )
    524548    );
    525549}
    526550
    527 $template->assign(
    528     array(
    529       'setup_errors'=> $setup_errors,
    530       'setup_warnings' => $setup_warnings,
    531     )
    532   );
    533 
    534551// +-----------------------------------------------------------------------+
    535552// |                           sending html code                           |
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r6625 r6629  
    251251    {/foreach}
    252252  </ul>
     253  <div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|@translate}</a></div>
    253254</div>
    254255  {/if}
Note: See TracChangeset for help on using the changeset viewer.