Changeset 13001


Ignore:
Timestamp:
Jan 31, 2012, 1:33:01 AM (12 years ago)
Author:
plg
Message:

bug 2558 fixed: instead of locking the gallery with a simple checkbox among
configuration options, "lock gallery" becomes a maintenance action, with a
confirmation on popup.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r12922 r13001  
    4747
    4848$main_checkboxes = array(
    49     'gallery_locked',
    5049    'allow_user_registration',
    5150    'obligatory_user_mail_address',
     
    173172      }
    174173     
    175       if (empty($_POST['gallery_locked']) and $conf['gallery_locked'])
    176       {
    177         $tpl_var = & $template->get_template_vars('header_msgs');
    178         $msg_key = array_search(l10n('The gallery is locked for maintenance. Please, come back later.'), $tpl_var);
    179         unset($tpl_var[$msg_key]);
    180       }
    181       elseif (!empty($_POST['gallery_locked']) and !$conf['gallery_locked'])
    182       {
    183         $template->append('header_msgs', l10n('The gallery is locked for maintenance. Please, come back later.'));
    184       }
    185174      foreach( $main_checkboxes as $checkbox)
    186175      {
  • trunk/admin/maintenance.php

    r12922 r13001  
    4848switch ($action)
    4949{
     50  case 'lock_gallery' :
     51  {
     52    conf_update_param('gallery_locked', 'true');
     53    redirect(get_root_url().'admin.php?page=maintenance');
     54    break;
     55  }
     56  case 'unlock_gallery' :
     57  {
     58    conf_update_param('gallery_locked', 'false');
     59    $_SESSION['page_infos'] = array(l10n('Gallery unlocked'));
     60    redirect(get_root_url().'admin.php?page=maintenance');
     61    break;
     62  }
    5063  case 'categories' :
    5164  {
     
    165178  );
    166179
     180if ($conf['gallery_locked'])
     181{
     182  $template->assign(
     183    array(
     184      'U_MAINT_UNLOCK_GALLERY' => sprintf($url_format, 'unlock_gallery'),
     185      )
     186    );
     187}
     188else
     189{
     190  $template->assign(
     191    array(
     192      'U_MAINT_LOCK_GALLERY' => sprintf($url_format, 'lock_gallery'),
     193      )
     194    );
     195}
     196
    167197// +-----------------------------------------------------------------------+
    168198// | Define advanced features                                              |
  • trunk/admin/themes/default/template/configuration.tpl

    r12894 r13001  
    3333  <legend></legend>
    3434  <ul>
    35     <li>
    36       <label>
    37         <span class="property">{'Lock gallery'|@translate}</span>
    38         <input type="checkbox" name="gallery_locked" {if ($main.gallery_locked)}checked="checked"{/if}>
    39       </label>
    40     </li>
    41 
    4235    <li>
    4336      <label>
  • trunk/admin/themes/default/template/maintenance.tpl

    r12797 r13001  
    44
    55<ul>
     6{if (isset($U_MAINT_LOCK_GALLERY))}
     7  <li><a href="{$U_MAINT_LOCK_GALLERY}" onclick="return confirm('{'A locked gallery is only visible to administrators'|@translate|@escape:'javascript'}');">{'Lock gallery'|@translate}</a></li>
     8{else}
     9  <li><a href="{$U_MAINT_UNLOCK_GALLERY}">{'Unlock gallery'|@translate}</a></li>
     10{/if}
     11</ul>
     12
     13<ul>
    614  {foreach from=$advanced_features item=feature}
    715    <li><a href="{$feature.URL}">{$feature.CAPTION}</a></li>
    816  {/foreach}
    9 </ul>
    10 
    11 <ul>
    12         <li><a href="{$U_MAINT_ORPHAN_TAGS}">{'Delete orphan tags'|@translate}</a></li>
    1317</ul>
    1418
     
    2428
    2529<ul>
     30        <li><a href="{$U_MAINT_ORPHAN_TAGS}">{'Delete orphan tags'|@translate}</a></li>
    2631        <li><a href="{$U_MAINT_HISTORY_DETAIL}" onclick="return confirm('{'Purge history detail'|@translate|@escape:'javascript'}');">{'Purge history detail'|@translate}</a></li>
    2732        <li><a href="{$U_MAINT_HISTORY_SUMMARY}" onclick="return confirm('{'Purge history summary'|@translate|@escape:'javascript'}');">{'Purge history summary'|@translate}</a></li>
  • trunk/language/en_UK/admin.lang.php

    r12930 r13001  
    833833$lang['Photo Sizes'] = 'Photo Sizes';
    834834$lang['Original Size'] = 'Original Size';
     835$lang['A locked gallery is only visible to administrators'] = 'A locked gallery is only visible to administrators';
     836$lang['Unlock gallery'] = 'Unlock gallery';
     837$lang['Gallery unlocked'] = 'Gallery unlocked';
    835838?>
  • trunk/language/fr_FR/admin.lang.php

    r12930 r13001  
    846846$lang['Activate comments'] = 'Activer les commentaires';
    847847$lang['Default comments order'] = 'Ordre par défaut des commentaires';
    848 
     848$lang['A locked gallery is only visible to administrators'] = 'Une galerie verrouillée n\'est visible que des administrateurs';
     849$lang['Unlock gallery'] = 'Déverouiller la galerie';
     850$lang['Gallery unlocked'] = 'Galerie déverouillée';
    849851?>
Note: See TracChangeset for help on using the changeset viewer.