Skip to content

Commit

Permalink
bug 2553 hide menubar/register on indentification page if gallery is …
Browse files Browse the repository at this point in the history
…locked or guest_access is false

git-svn-id: http://piwigo.org/svn/trunk@12878 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Jan 12, 2012
1 parent 6559048 commit 6a11500
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion admin/themes/default/template/configuration.tpl
Expand Up @@ -271,7 +271,7 @@ jQuery(document).ready(function () {

<li>
<label>
<span class="property">{'Sort order'|@translate|@string_format:$pwg->l10n('Activate field "%s"')}</span>
<span class="property">{'Sort order'|@translate|@string_format:$pwg->l10n('Activate icon "%s"')}</span>
<input type="checkbox" name="index_sort_order_input" {if ($display.index_sort_order_input)}checked="checked"{/if}>
</label>
</li>
Expand Down
12 changes: 8 additions & 4 deletions identification.php
Expand Up @@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org |
// | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
Expand Down Expand Up @@ -82,21 +82,25 @@

$template->assign(
array(
'U_LOST_PASSWORD' => get_root_url().'password.php',
'U_REDIRECT' => $redirect_to,

'F_LOGIN_ACTION' => get_root_url().'identification.php',
'authorize_remembering' => $conf['authorize_remembering'],
));

if ($conf['allow_user_registration'])
if (!$conf['gallery_locked'] && $conf['allow_user_registration'])
{
$template->assign('U_REGISTER', get_root_url().'register.php' );
}

if (!$conf['gallery_locked'])
{
$template->assign('U_LOST_PASSWORD', get_root_url().'password.php' );
}

// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) OR !in_array('theIdentificationPage', $themeconf['hide_menu_on']))
if (!$conf['gallery_locked'] && (!isset($themeconf['hide_menu_on']) OR !in_array('theIdentificationPage', $themeconf['hide_menu_on'])))
{
include( PHPWG_ROOT_PATH.'include/menubar.inc.php');
}
Expand Down
17 changes: 10 additions & 7 deletions include/functions.inc.php
Expand Up @@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org |
// | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
Expand Down Expand Up @@ -1076,14 +1076,17 @@ function load_conf_from_db($condition = '')

while ($row = pwg_db_fetch_assoc($result))
{
$conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : '';

// If the field is true or false, the variable is transformed into a
// boolean value.
if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false')
$val = isset($row['value']) ? $row['value'] : '';
// If the field is true or false, the variable is transformed into a boolean value.
if ($val == 'true')
{
$val = true;
}
elseif ($val == 'false')
{
$conf[ $row['param'] ] = get_boolean($conf[ $row['param'] ]);
$val = false;
}
$conf[ $row['param'] ] = $val;
}
}

Expand Down
1 change: 0 additions & 1 deletion language/en_UK/admin.lang.php
Expand Up @@ -97,7 +97,6 @@
$lang['ACCESS_5'] = "No access";
$lang['Action'] = 'Action';
$lang['Actions'] = "Actions";
$lang['Activate field "%s"'] = 'Activate field "%s"';
$lang['Activate icon "%s"'] = 'Activate icon "%s"';
$lang['Activate icon "new" next to albums and pictures'] = 'Activate icon "new" next to albums and pictures';
$lang['Activate Navigation Bar'] = 'Activate navigation bar';
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/about.tpl
@@ -1,5 +1,5 @@
{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
<div class="titrePage">
<ul class="categoryActions">
<li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/comments.tpl
@@ -1,5 +1,5 @@
{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">

<div class="titrePage">
<ul class="categoryActions">
Expand Down
8 changes: 5 additions & 3 deletions themes/default/template/identification.tpl
@@ -1,5 +1,5 @@
{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">

<div class="titrePage">
<ul class="categoryActions">
Expand Down Expand Up @@ -47,16 +47,18 @@
<input tabindex="4" type="submit" name="login" value="{'Submit'|@translate}">
</p>

<p>
<p>
{if isset($U_REGISTER)}
<a href="{$U_REGISTER}" title="{'Register'|@translate}" class="pwg-state-default pwg-button">
<span class="pwg-icon pwg-icon-register">&nbsp;</span><span>{'Register'|@translate}</span>
</a>
{/if}
{if isset($U_LOST_PASSWORD)}
<a href="{$U_LOST_PASSWORD}" title="{'Forgot your password?'|@translate}" class="pwg-state-default pwg-button">
<span class="pwg-icon pwg-icon-lost-password">&nbsp;</span><span>{'Forgot your password?'|@translate}</span>
</a>
</p>
{/if}
</p>

</form>

Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/index.tpl
@@ -1,6 +1,6 @@
{$MENUBAR}
{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
<div class="titrePage">
<ul class="categoryActions">
{if !empty($image_orders)}
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/notification.tpl
Expand Up @@ -4,7 +4,7 @@
{/html_head}

{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">

<div class="titrePage">
<ul class="categoryActions">
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/picture.tpl
Expand Up @@ -4,7 +4,7 @@

{if isset($MENUBAR)}
{$MENUBAR}
<div id="content" class="pictureContent">
<div id="content" class="contentWithMenu">
{/if}

{include file='infos_errors.tpl'}
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/profile.tpl
@@ -1,5 +1,5 @@
{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">

<div class="titrePage">
<ul class="categoryActions">
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/search.tpl
Expand Up @@ -15,7 +15,7 @@
*}

{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">

<div class="titrePage">
<ul class="categoryActions">
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/tags.tpl
@@ -1,5 +1,5 @@
{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content" class="content">
<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">

<div class="titrePage">
<ul class="categoryActions">
Expand Down
10 changes: 3 additions & 7 deletions themes/default/theme.css
Expand Up @@ -83,7 +83,7 @@
/**
* Content
*/
.content {
.contentWithMenu {
margin-left: 20em; /* = #menubar width + 2em */
}

Expand Down Expand Up @@ -417,12 +417,8 @@ TD.calDayHead {
background: url('icon/rating-stars.gif') no-repeat 0 center; width:16px;
}

/* only if menubar is shown */
.pictureContent {
margin-left:20em;
}
.pictureContent #imageToolBar,
.pictureContent #theImage {
.contentWithMenu #imageToolBar,
.contentWithMenu #theImage {
clear: none;
}

Expand Down

0 comments on commit 6a11500

Please sign in to comment.