BuddyDev

Search

Enable – disable a tab in a member group

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 33
    Vlad on #42541

    Hello,
    Thanks for any help.

    I have a member group tab,
    I made an enable-disable checkbox in css (style),
    but the link is available in the code.
    Is it possible to enable / disable a tab in the settings of a group of participants.

    here is my code

    
    	/** settings_screen() is the catch-all method for displaying the content of the edit, create, and Dashboard admin panels **/
    	 
    	function settings_screen( $group_id = NULL ) {
            $group_id = bp_get_group_id();
    	?>
    	
        <p>To disable the tab, select the checkbox and click the Save button</p>	
    
        <div id="group_place">
            <label><input type="checkbox" name="group_place" id="group_place" value="1" <?php if ( groups_get_groupmeta( $group_id, 'group_place' ) ): ?> checked="checked"<?php endif; ?> />Отключить Билеты</label>
        </div>
    	<input type="hidden" id="style_group_place" name="style_group_place" value="#nav-group-place-groups-li,li#nav-group-place-groups-li,a#nav-group-place{display:none!important;}" />
    <?php
    
    	}
    
    	/** settings_screen_save() contains the catch-all logic for saving settings from the edit, create, and Dashboard admin panels **/
    	function settings_screen_save( $group_id = NULL ) { 
    
            $setting = $_POST['group_place'];
    		groups_update_groupmeta( $group_id, 'group_place', $setting );
    		
            $value = $_POST['style_group_place'];
    		groups_update_groupmeta( $group_id, 'style_group_place', $value );
    		
    	} 
    
    }
    

You must be logged in to reply to this topic.

This topic is: not resolved