Changeset 5240

Show
Ignore:
Timestamp:
03/22/10 01:21:25 (3 years ago)
Author:
plg
Message:

feature 1505: improvement, when there is no photo yet in the gallery, first
shows a connection box (and only this), then if the user is an admin shows the
"Hello %s, your gallery is empty...".

I've also added the ability to deactivate this message. Only an admin can
deactivate it.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r5238 r5240  
    181181  { 
    182182    $template->set_filenames(array('no_photo_yet'=>'no_photo_yet.tpl')); 
    183  
    184     $url = $conf['no_photo_yet_url']; 
    185     if (substr($url, 0, 4) != 'http') 
     183     
     184    if (is_admin()) 
    186185    { 
    187       $url = get_root_url().$url; 
     186      if (isset($_GET['no_photo_yet'])) 
     187      { 
     188        conf_update_param('no_photo_yet', 'false'); 
     189        redirect(make_index_url()); 
     190        exit(); 
     191      } 
     192       
     193      $url = $conf['no_photo_yet_url']; 
     194      if (substr($url, 0, 4) != 'http') 
     195      { 
     196        $url = get_root_url().$url; 
     197      } 
     198       
     199      $template->assign( 
     200        array( 
     201          'step' => 2, 
     202          'intro' => sprintf( 
     203            l10n('Hello %s, your Piwigo photo gallery is empty!'), 
     204            $user['username'] 
     205            ), 
     206          'next_step_url' => $url, 
     207          'deactivate_url' => get_root_url().'?no_photo_yet=deactivate', 
     208          ) 
     209        ); 
     210    } 
     211    else 
     212    { 
     213       
     214      $template->assign( 
     215        array( 
     216          'step' => 1, 
     217          'U_LOGIN' => 'identification.php', 
     218          ) 
     219        ); 
    188220    } 
    189221     
    190     $template->assign(array('next_step_url' => $url)); 
    191222    $template->pparse('no_photo_yet'); 
    192223    exit(); 
  • trunk/themes/default/template/no_photo_yet.tpl

    r5138 r5240  
    33<head> 
    44<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
     5<link rel="stylesheet" type="text/css" href="themes/Sylvia/theme.css"> 
    56<title>Piwigo, {'Welcome'|@translate}</title> 
    67{literal} 
     
    1112background-color:#111; 
    1213} 
     14 
     15P {text-align:center;} 
     16TD {color:#888;} 
    1317 
    1418#global { 
     
    2933.bigButton {} 
    3034 
    31 .bigButton {text-align:center; margin-top:130px;} 
     35.bigButton {text-align:center; margin-top:120px;} 
    3236 
    3337.bigButton a { 
     
    4852    outline:none; 
    4953    color:#ff3333; 
     54    border:none; 
     55} 
     56 
     57#connectionBox { 
     58    margin:0 auto; 
     59    margin-top:70px; 
     60} 
     61 
     62#deactivate { 
     63    position:absolute; 
     64    bottom:10px; 
     65    text-align:center; 
     66    width:100%; 
     67 
     68    font-style:normal; 
     69} 
     70 
     71#deactivate A { 
     72    text-decoration:none; 
     73    border:none; 
    5074} 
    5175</style> 
     
    5680<body> 
    5781<div id="global"> 
     82 
     83{if $step == 1} 
    5884<p id="noPhotoWelcome">{'Welcome to your Piwigo photo gallery!'|@translate}</p> 
    59 <div class="bigButton"><a href="{$next_step_url}">{'Add Photos'|@translate}</a></div> 
     85 
     86<form method="post" action="{$U_LOGIN}" id="quickconnect"> 
     87<table id="connectionBox"> 
     88  <tr> 
     89    <td>{'Username'|@translate}</td> 
     90    <td><input type="text" name="username"></td> 
     91  </tr> 
     92  <tr> 
     93    <td>{'Password'|@translate}</td> 
     94    <td><input type="text" name="password"></td> 
     95  </tr> 
     96</table> 
     97 
     98<p><input class="submit" type="submit" name="login" value="{'Login'|@translate}"></p> 
     99</form> 
     100 
     101 
     102{else} 
     103<p id="noPhotoWelcome">{$intro}</p> 
     104<div class="bigButton"><a href="{$next_step_url}">{'I want to add photos'|@translate}</a></div> 
     105<div id="deactivate"><a href="{$deactivate_url}">{'I will find my way by myself, please deactivate this message'|@translate}</a></div> 
     106{/if} 
     107 
     108 
    60109</div> 
    61110</body>