Skip to content

Commit

Permalink
feature 1505: improvement, ability to browse the empty gallery. The "…
Browse files Browse the repository at this point in the history
…no photo

yet" feature can be deactivated at session level.

git-svn-id: http://piwigo.org/svn/trunk@5241 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Mar 22, 2010
1 parent fbfe113 commit 3fde53f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
22 changes: 17 additions & 5 deletions include/common.inc.php
Expand Up @@ -169,6 +169,7 @@ function sanitize_mysql_kv(&$v, $k)
!isset($conf['no_photo_yet']) // the message disappears at first photo
and !(defined('IN_ADMIN') and IN_ADMIN) // no message inside administration
and script_basename() != 'identification' // keep the ability to login
and !isset($_SESSION['no_photo_yet']) // temporary hide
)
{
$query = '
Expand All @@ -179,17 +180,27 @@ function sanitize_mysql_kv(&$v, $k)
list($nb_photos) = pwg_db_fetch_row(pwg_query($query));
if (0 == $nb_photos)
{
$template->set_filenames(array('no_photo_yet'=>'no_photo_yet.tpl'));

if (is_admin())
if (isset($_GET['no_photo_yet']))
{
if (isset($_GET['no_photo_yet']))
if ('browse' == $_GET['no_photo_yet'])
{
$_SESSION['no_photo_yet'] = 'browse';
redirect(make_index_url());
exit();
}

if ('deactivate' == $_GET['no_photo_yet'])
{
conf_update_param('no_photo_yet', 'false');
redirect(make_index_url());
exit();
}

}

$template->set_filenames(array('no_photo_yet'=>'no_photo_yet.tpl'));

if (is_admin())
{
$url = $conf['no_photo_yet_url'];
if (substr($url, 0, 4) != 'http')
{
Expand All @@ -215,6 +226,7 @@ function sanitize_mysql_kv(&$v, $k)
array(
'step' => 1,
'U_LOGIN' => 'identification.php',
'deactivate_url' => get_root_url().'?no_photo_yet=browse',
)
);
}
Expand Down
10 changes: 8 additions & 2 deletions themes/default/template/no_photo_yet.tpl
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="themes/default/theme.css">
<link rel="stylesheet" type="text/css" href="themes/Sylvia/theme.css">
<title>Piwigo, {'Welcome'|@translate}</title>
{literal}
Expand All @@ -13,7 +14,7 @@ background-color:#111;
}

P {text-align:center;}
TD {color:#888;}
TD {color:#888; letter-spacing:1px;}

#global {
position:absolute;
Expand Down Expand Up @@ -66,8 +67,11 @@ border:2px solid #FF3363;
width:100%;
font-style:normal;
font-size:1.0em;
}

.submit {font-size:1.0em; letter-spacing:2px; font-weight:normal;}

#deactivate A {
text-decoration:none;
border:none;
Expand Down Expand Up @@ -96,13 +100,15 @@ border:2px solid #FF3363;
</table>

<p><input class="submit" type="submit" name="login" value="{'Login'|@translate}"></p>

<div id="deactivate"><a href="{$deactivate_url}">{'... or browse your empty gallery'|@translate}</a></div>
</form>


{else}
<p id="noPhotoWelcome">{$intro}</p>
<div class="bigButton"><a href="{$next_step_url}">{'I want to add photos'|@translate}</a></div>
<div id="deactivate"><a href="{$deactivate_url}">{'I will find my way by myself, please deactivate this message'|@translate}</a></div>
<div id="deactivate"><a href="{$deactivate_url}">{'... or please deactivate this message, I will find my way by myself'|@translate}</a></div>
{/if}


Expand Down

0 comments on commit 3fde53f

Please sign in to comment.