- Timestamp:
- Aug 17, 2014, 10:01:10 PM (10 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r28587 r29229 137 137 $cat_info = get_cat_info($_GET['cat_id']); 138 138 139 if ($cat_info['visible'] != get_boolean( $_POST['visible'] ) ) 139 if ($_POST['visible']=='true_sub') 140 { 141 set_cat_visible(array($_GET['cat_id']), true, true); 142 } 143 elseif ($cat_info['visible'] != get_boolean( $_POST['visible'] ) ) 140 144 { 141 145 set_cat_visible(array($_GET['cat_id']), $_POST['visible']); -
trunk/admin/include/functions.php
r29068 r29229 645 645 * @param int[] $categories 646 646 * @param boolean|string $value 647 */ 648 function set_cat_visible($categories, $value) 647 * @param boolean $unlock_child optional default false 648 */ 649 function set_cat_visible($categories, $value, $unlock_child = false) 649 650 { 650 651 if ( ($value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) === null ) … … 657 658 if ($value) 658 659 { 659 $uppercats = get_uppercat_ids($categories); 660 $cats = get_uppercat_ids($categories); 661 if ($unlock_child) { 662 $cats = array_merge($cats, get_subcat_ids($categories)); 663 } 660 664 $query = ' 661 665 UPDATE '.CATEGORIES_TABLE.' 662 666 SET visible = \'true\' 663 WHERE id IN ('.implode(',', $ uppercats).')';667 WHERE id IN ('.implode(',', $cats).')'; 664 668 pwg_query($query); 665 669 } -
trunk/admin/themes/default/template/cat_modify.tpl
r28703 r29229 118 118 <strong>{'Lock'|@translate}</strong> 119 119 <br> 120 {html_radios name='visible' values=['true',' false'] output=['No'|translate,'Yes'|translate] selected=$CAT_VISIBLE}120 {html_radios name='visible' values=['true','true_sub','false'] output=['No'|translate,'No and unlock sub-albums'|translate,'Yes'|translate] selected=$CAT_VISIBLE} 121 121 </p> 122 122
Note: See TracChangeset
for help on using the changeset viewer.