aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_options.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-08-13 23:09:54 +0000
committerplegall <plg@piwigo.org>2005-08-13 23:09:54 +0000
commit1549745402270b86d2116b8f2a498fddf28ea2e8 (patch)
tree5a6b29e9ef9d7a98d58725685f4170d0a892a793 /admin/cat_options.php
parent273884a65274e2688df1b2d3dc37103a46117772 (diff)
- new : maintenance screen in administration. There you can update
categories informations (number of images, date of the last added element), update images informations (path, average rate), purge obsolete sessions, purge history. - new : ability to have random representative for categories. This configuration parameter is set to false by default. - new : ability to set an element as representative of a category without belonging to the category. Thus, administrator can choose representative even for empty categories. - improvement : semantically superior design for category edition screen by regrouping fields in fieldsets. The improved screen contains action buttons as in category list screen. - new : ability to move a virtual category (ie change its parent category). - bug fixed : the sync_users function checks all user children tables (access, cache, group association). git-svn-id: http://piwigo.org/svn/trunk@809 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/cat_options.php')
-rw-r--r--admin/cat_options.php44
1 files changed, 40 insertions, 4 deletions
diff --git a/admin/cat_options.php b/admin/cat_options.php
index d4fa2dd92..fc10cbc05 100644
--- a/admin/cat_options.php
+++ b/admin/cat_options.php
@@ -72,6 +72,16 @@ UPDATE '.CATEGORIES_TABLE.'
set_cat_status($_POST['cat_true'], 'private');
break;
}
+ case 'representative' :
+ {
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET representative_picture_id = NULL
+ WHERE id IN ('.implode(',', $_POST['cat_true']).')
+;';
+ pwg_query($query);
+ break;
+ }
}
}
else if (isset($_POST['trueify'])
@@ -110,6 +120,13 @@ UPDATE '.CATEGORIES_TABLE.'
set_cat_status($_POST['cat_false'], 'public');
break;
}
+ case 'representative' :
+ {
+ // theoretically, all categories in $_POST['cat_false'] contain at
+ // least one element, so PhpWebGallery can find a representant.
+ set_random_representant($_POST['cat_false']);
+ break;
+ }
}
}
// +-----------------------------------------------------------------------+
@@ -178,7 +195,6 @@ SELECT id,name,uppercats,global_rank
'L_CAT_OPTIONS_INFO' => $lang['cat_upload_info'],
)
);
- $template->assign_block_vars('upload', array());
break;
}
case 'comments' :
@@ -201,7 +217,6 @@ SELECT id,name,uppercats,global_rank
'L_CAT_OPTIONS_INFO' => $lang['cat_comments_info'],
)
);
- $template->assign_block_vars('comments', array());
break;
}
case 'visible' :
@@ -224,7 +239,6 @@ SELECT id,name,uppercats,global_rank
'L_CAT_OPTIONS_INFO' => $lang['cat_lock_info'],
)
);
- $template->assign_block_vars('visible', array());
break;
}
case 'status' :
@@ -247,7 +261,29 @@ SELECT id,name,uppercats,global_rank
'L_CAT_OPTIONS_INFO' => $lang['cat_status_info'],
)
);
- $template->assign_block_vars('status', array());
+ break;
+ }
+ case 'representative' :
+ {
+ $query_true = '
+SELECT id,name,uppercats,global_rank
+ FROM '.CATEGORIES_TABLE.'
+ WHERE representative_picture_id IS NOT NULL
+;';
+ $query_false = '
+SELECT id,name,uppercats,global_rank
+ FROM '.CATEGORIES_TABLE.'
+ WHERE nb_images != 0
+ AND representative_picture_id IS NULL
+;';
+ $template->assign_vars(
+ array(
+ 'L_CAT_TITLE' => l10n('Representative'),
+ 'L_CAT_OPTIONS_TRUE' => l10n('singly represented'),
+ 'L_CAT_OPTIONS_FALSE' => l10n('randomly represented'),
+ 'L_CAT_OPTIONS_INFO' => l10n('')
+ )
+ );
break;
}
}