mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-20 00:23:40 +02:00
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. git-svn-id: http://piwigo.org/svn/trunk@5240 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+36
-5
@@ -180,14 +180,45 @@ SELECT
|
||||
if (0 == $nb_photos)
|
||||
{
|
||||
$template->set_filenames(array('no_photo_yet'=>'no_photo_yet.tpl'));
|
||||
|
||||
$url = $conf['no_photo_yet_url'];
|
||||
if (substr($url, 0, 4) != 'http')
|
||||
|
||||
if (is_admin())
|
||||
{
|
||||
$url = get_root_url().$url;
|
||||
if (isset($_GET['no_photo_yet']))
|
||||
{
|
||||
conf_update_param('no_photo_yet', 'false');
|
||||
redirect(make_index_url());
|
||||
exit();
|
||||
}
|
||||
|
||||
$url = $conf['no_photo_yet_url'];
|
||||
if (substr($url, 0, 4) != 'http')
|
||||
{
|
||||
$url = get_root_url().$url;
|
||||
}
|
||||
|
||||
$template->assign(
|
||||
array(
|
||||
'step' => 2,
|
||||
'intro' => sprintf(
|
||||
l10n('Hello %s, your Piwigo photo gallery is empty!'),
|
||||
$user['username']
|
||||
),
|
||||
'next_step_url' => $url,
|
||||
'deactivate_url' => get_root_url().'?no_photo_yet=deactivate',
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$template->assign(
|
||||
array(
|
||||
'step' => 1,
|
||||
'U_LOGIN' => 'identification.php',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$template->assign(array('next_step_url' => $url));
|
||||
$template->pparse('no_photo_yet');
|
||||
exit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user