From 02ce640d3e2478cddd3d8cad301e5fd090b11bd3 Mon Sep 17 00:00:00 2001 From: flop25 Date: Sun, 24 Aug 2014 20:56:41 +0000 Subject: feature:3126 Apply on subalbum checkbox about comments git-svn-id: http://piwigo.org/svn/trunk@29265 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_modify.php | 10 ++++++++++ admin/themes/default/template/cat_modify.tpl | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'admin') diff --git a/admin/cat_modify.php b/admin/cat_modify.php index a3c34ada5..c2d47fb51 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -132,6 +132,16 @@ if (isset($_POST['submit'])) $data, array('id' => $data['id']) ); + if ($_POST['apply_commentable_on_sub']) + { + $subcats = get_subcat_ids(array('id' => $data['id'])); + $query = ' +UPDATE '.CATEGORIES_TABLE.' + SET commentable = \''.$data['commentable'].'\' + WHERE id IN ('.implode(',', $subcats).') +;'; + pwg_query($query); + } // retrieve cat infos before continuing (following updates are expensive) $cat_info = get_cat_info($_GET['cat_id']); diff --git a/admin/themes/default/template/cat_modify.tpl b/admin/themes/default/template/cat_modify.tpl index 52f47d90f..6d46c9ee1 100644 --- a/admin/themes/default/template/cat_modify.tpl +++ b/admin/themes/default/template/cat_modify.tpl @@ -125,6 +125,10 @@ categoriesCache.selectize(jQuery('[data-selectize=categories]'), { {'Comments'|@translate}
{html_radios name='commentable' values=['false','true'] output=['No'|translate,'Yes'|translate] selected=$CAT_COMMENTABLE} +

{/if} -- cgit v1.2.3