Skip to content

Commit

Permalink
feature 2581: new design on albums list management.
Browse files Browse the repository at this point in the history
icons removed, replaced by text links visible on :hover

better ergonomy for automatic order: the "save manual order" submit button
only appears when a change is detected in the album ordering. The "automatic
sort order" becomes a dedicated fieldset, hidden by default, displayed "on
user demand".

new virtual album form displayed only "on user demand"

cat_list, cat_move and permalinks are 3 tabs for the "Albums > Manage" link
in the menubar.

permalinks admin page slightly redesign: fieldsets instead of centered h3,
"on user demand" form to add/modify permalinks.


git-svn-id: http://piwigo.org/svn/trunk@13282 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Feb 20, 2012
1 parent 4c19a24 commit 12bf0f7
Show file tree
Hide file tree
Showing 15 changed files with 309 additions and 166 deletions.
2 changes: 0 additions & 2 deletions admin.php
Expand Up @@ -196,7 +196,6 @@
'U_CONFIG_LANGUAGES' => $link_start.'languages',
'U_CONFIG_THEMES'=> $link_start.'themes',
'U_CATEGORIES'=> $link_start.'cat_list',
'U_MOVE'=> $link_start.'cat_move',
'U_CAT_OPTIONS'=> $link_start.'cat_options',
'U_CAT_UPDATE'=> $link_start.'site_update&site=1',
'U_RATING'=> $link_start.'rating',
Expand All @@ -205,7 +204,6 @@
'U_TAGS'=> $link_start.'tags',
'U_USERS'=> $link_start.'user_list',
'U_GROUPS'=> $link_start.'group_list',
'U_PERMALINKS'=> $link_start.'permalinks',
'U_RETURN'=> get_gallery_home_url(),
'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
'U_LOGOUT'=> PHPWG_ROOT_PATH.'index.php?act=logout',
Expand Down
100 changes: 52 additions & 48 deletions admin/cat_list.php
Expand Up @@ -99,6 +99,13 @@ function save_categories_order($categories)
$navigation.= l10n('Home');
$navigation.= '</a>';

// +-----------------------------------------------------------------------+
// | tabs |
// +-----------------------------------------------------------------------+

$page['tab'] = 'list';
include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');

// +-----------------------------------------------------------------------+
// | virtual categories management |
// +-----------------------------------------------------------------------+
Expand Down Expand Up @@ -134,71 +141,68 @@ function save_categories_order($categories)
}
}
// save manual category ordering
else if (isset($_POST['submitOrder']))
else if (isset($_POST['submitManualOrder']))
{
if ('manual' == $_POST['order_type'])
{
asort($_POST['catOrd'], SORT_NUMERIC);
save_categories_order(array_keys($_POST['catOrd']));
asort($_POST['catOrd'], SORT_NUMERIC);
save_categories_order(array_keys($_POST['catOrd']));

array_push(
$page['infos'],
l10n('Album manual order was saved')
);
}
else
{
$query = '
array_push(
$page['infos'],
l10n('Album manual order was saved')
);
}
else if (isset($_POST['submitAutoOrder']))
{
$query = '
SELECT id
FROM '.CATEGORIES_TABLE.'
WHERE id_uppercat '.
(!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).'
;';
$category_ids = array_from_query($query, 'id');
$category_ids = array_from_query($query, 'id');

if (isset($_POST['recursive']))
{
$category_ids = get_subcat_ids($category_ids);
}

$categories = array();
$names = array();
$id_uppercats = array();
if (isset($_POST['recursive']))
{
$category_ids = get_subcat_ids($category_ids);
}
$categories = array();
$names = array();
$id_uppercats = array();

$query = '
$query = '
SELECT id, name, id_uppercat
FROM '.CATEGORIES_TABLE.'
WHERE id IN ('.implode(',', $category_ids).')
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
array_push(
$categories,
array(
'id' => $row['id'],
'id_uppercat' => $row['id_uppercat'],
)
);
array_push(
$names,
$row['name']
);
}

array_multisort(
$names,
SORT_REGULAR,
'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC,
$categories
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
array_push(
$categories,
array(
'id' => $row['id'],
'id_uppercat' => $row['id_uppercat'],
)
);
save_categories_order($categories);

array_push(
$page['infos'],
l10n('Albums automatically sorted')
$names,
$row['name']
);
}

array_multisort(
$names,
SORT_REGULAR,
'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC,
$categories
);
save_categories_order($categories);

array_push(
$page['infos'],
l10n('Albums automatically sorted')
);
}

// +-----------------------------------------------------------------------+
Expand Down
7 changes: 7 additions & 0 deletions admin/cat_move.php
Expand Up @@ -70,6 +70,13 @@
)
);

// +-----------------------------------------------------------------------+
// | tabs |
// +-----------------------------------------------------------------------+

$page['tab'] = 'move';
include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');

// +-----------------------------------------------------------------------+
// | Categories display |
// +-----------------------------------------------------------------------+
Expand Down
35 changes: 35 additions & 0 deletions admin/include/albums_tab.inc.php
@@ -0,0 +1,35 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | 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 |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+

include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');

$my_base_url = get_root_url().'admin.php?page=';

$tabsheet = new tabsheet();
$tabsheet->add('list', l10n('List'), $my_base_url.'cat_list');
$tabsheet->add('move', l10n('Move'), $my_base_url.'cat_move');
$tabsheet->add('permalinks', l10n('Permalinks'), $my_base_url.'permalinks');
$tabsheet->select($page['tab']);
$tabsheet->assign();

?>
10 changes: 9 additions & 1 deletion admin/permalinks.php
Expand Up @@ -49,7 +49,7 @@ function parse_sort_variables(
foreach( $sortable_by as $field)
{
$url = $base_url;
$disp = '&dArr;'; // TODO: an small image is better
$disp = ''; // TODO: an small image is better

if ( $field !== @$_GET[$get_param] )
{
Expand Down Expand Up @@ -106,6 +106,14 @@ function parse_sort_variables(

$template->set_filename('permalinks', 'permalinks.tpl' );

// +-----------------------------------------------------------------------+
// | tabs |
// +-----------------------------------------------------------------------+

$page['tab'] = 'permalinks';
include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');


$query = '
SELECT
id, permalink,
Expand Down
Binary file modified admin/themes/clear/icon/cat_move.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion admin/themes/clear/theme.css
Expand Up @@ -116,7 +116,7 @@ INPUT.bigbutton:hover { background-color: #ddd; color:#0cc; border: 0; }
.throw { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; }
label { cursor:pointer }
.categoryLi, .menuLi { background: #ddd }
.virtual_cat, .menuLi_hidden { background: #ccc !important; }
.menuLi_hidden { background: #ccc !important; }
a.Piwigo {
font-family: verdana, arial, helvetica, sans-serif !important;
font-size: 11px; font-weight: normal; letter-spacing: 0;
Expand Down Expand Up @@ -311,3 +311,5 @@ input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hove
background-color:#ff7700;
color:white;
}

p.albumTitle img {margin-bottom:-3px;}
2 changes: 0 additions & 2 deletions admin/themes/default/template/admin.tpl
Expand Up @@ -49,9 +49,7 @@ Raphael("menubarUsers", 20, 16).path("").scale(0.6, 0.6, 0, 0).attr({fill: "#464
<dd>
<ul>
<li><a href="{$U_CATEGORIES}">{'Manage'|@translate}</a></li>
<li><a href="{$U_MOVE}">{'Move'|@translate}</a></li>
<li><a href="{$U_CAT_OPTIONS}">{'Properties'|@translate}</a></li>
<li><a href="{$U_PERMALINKS}">{'Permalinks'|@translate}</a></li>
</ul>
</dd>
</dl>
Expand Down

0 comments on commit 12bf0f7

Please sign in to comment.