aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_options.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-12-04 12:10:17 +0000
committerplegall <plg@piwigo.org>2004-12-04 12:10:17 +0000
commita383f3148cb7c9a23dadbdcd12ede4e1de274af5 (patch)
treea377701a2aa7da5c43a354ca52457b8a4f946985 /admin/cat_options.php
parent6fa03e0cca6855e041de004d49e0dd1b03bd644f (diff)
- change "->" in a beautiful arrow :-) for categories level in admin
- single category management screen updated : commentable and uploadable properties added, full directory displayed, status and visibility properties update uses inheritance, user favorite elements check moved to somewhere else : would be too long to calculate here for too many users - new admin functions set_cat_visible and set_cat_status : visibility and status updates can be done in cat_options and cat_modify - language : differentiate "locked" (state) and "lock" (action) git-svn-id: http://piwigo.org/svn/trunk@632 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/cat_options.php')
-rw-r--r--admin/cat_options.php66
1 files changed, 6 insertions, 60 deletions
diff --git a/admin/cat_options.php b/admin/cat_options.php
index 29e583150..502539d71 100644
--- a/admin/cat_options.php
+++ b/admin/cat_options.php
@@ -64,26 +64,12 @@ UPDATE '.CATEGORIES_TABLE.'
}
case 'visible' :
{
- // locking a category => all its child categories become locked
- $subcats = get_subcat_ids($_POST['cat_true']);
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET visible = \'false\'
- WHERE id IN ('.implode(',', $subcats).')
-;';
- pwg_query($query);
+ set_cat_visible($_POST['cat_true'], 'false');
break;
}
case 'status' :
{
- // make a category private => all its child categories become private
- $subcats = get_subcat_ids($_POST['cat_true']);
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET status = \'private\'
- WHERE id IN ('.implode(',', $subcats).')
-;';
- pwg_query($query);
+ set_cat_status($_POST['cat_true'], 'private');
break;
}
}
@@ -116,52 +102,12 @@ UPDATE '.CATEGORIES_TABLE.'
}
case 'visible' :
{
- // unlocking a category => all its parent categories become unlocked
- $uppercats = array();
- $query = '
-SELECT uppercats
- FROM '.CATEGORIES_TABLE.'
- WHERE id IN ('.implode(',', $_POST['cat_false']).')
-;';
- $result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
- {
- $uppercats = array_merge($uppercats,
- explode(',', $row['uppercats']));
- }
- $uppercats = array_unique($uppercats);
-
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET visible = \'true\'
- WHERE id IN ('.implode(',', $uppercats).')
-;';
- pwg_query($query);
+ set_cat_visible($_POST['cat_false'], 'true');
break;
}
case 'status' :
{
- // make public a category => all its parent categories become public
- $uppercats = array();
- $query = '
-SELECT uppercats
- FROM '.CATEGORIES_TABLE.'
- WHERE id IN ('.implode(',', $_POST['cat_false']).')
-;';
- $result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
- {
- $uppercats = array_merge($uppercats,
- explode(',', $row['uppercats']));
- }
- $uppercats = array_unique($uppercats);
-
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET status = \'public\'
- WHERE id IN ('.implode(',', $uppercats).')
-;';
- pwg_query($query);
+ set_cat_status($_POST['cat_false'], 'public');
break;
}
}
@@ -273,8 +219,8 @@ SELECT id,name,uppercats,global_rank
$template->assign_vars(
array(
'L_CAT_TITLE' => $lang['cat_lock_title'],
- 'L_CAT_OPTIONS_TRUE' => $lang['lock'],
- 'L_CAT_OPTIONS_FALSE' => $lang['unlock'],
+ 'L_CAT_OPTIONS_TRUE' => $lang['unlocked'],
+ 'L_CAT_OPTIONS_FALSE' => $lang['locked'],
'L_CAT_OPTIONS_INFO' => $lang['cat_lock_info'],
)
);