aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/cat_perm.php4
-rw-r--r--admin/themes/default/template/cat_perm.tpl1
2 files changed, 4 insertions, 1 deletions
diff --git a/admin/cat_perm.php b/admin/cat_perm.php
index 84a8d5784..961cf9f0f 100644
--- a/admin/cat_perm.php
+++ b/admin/cat_perm.php
@@ -88,10 +88,12 @@ else if (isset($_POST['grant_groups_submit'])
and isset($_POST['grant_groups'])
and count($_POST['grant_groups']) > 0)
{
+ $cat_ids = (isset($_POST['apply_on_sub'])) ? implode(',', get_subcat_ids(array($page['cat']))).",".implode(',', get_uppercat_ids(array($page['cat']))) : implode(',', get_uppercat_ids(array($page['cat'])));
+
$query = '
SELECT id
FROM '.CATEGORIES_TABLE.'
- WHERE id IN ('.implode(',', get_uppercat_ids(array($page['cat']))).')
+ WHERE id IN ('.$cat_ids.')
AND status = \'private\'
;';
$private_uppercats = array_from_query($query, 'id');
diff --git a/admin/themes/default/template/cat_perm.tpl b/admin/themes/default/template/cat_perm.tpl
index 76e9d3214..33ff39884 100644
--- a/admin/themes/default/template/cat_perm.tpl
+++ b/admin/themes/default/template/cat_perm.tpl
@@ -25,6 +25,7 @@
<li><label><input type="checkbox" name="grant_groups[]" value="{$id}"> {$all_groups[$id]}</label></li>
{/foreach}
</ul>
+ <label><input type="checkbox" name="apply_on_sub">{'Apply to sub-album'|@translate}</label>
<input class="submit" type="submit" name="grant_groups_submit" value="{'Grant selected groups'|@translate}">
</fieldset>