<?php
// +-------------------------------------------------+
// | 2002-2011 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: list_role_rights_tabs_subtabs_ui.class.php,v 1.1 2025/09/04 07:16:13 dgoron Exp $

if (stristr($_SERVER['REQUEST_URI'], ".class.php")) die("no access");

class list_role_rights_tabs_subtabs_ui extends list_role_rights_ui {

    /**
     * Initialisation des droits sur les menus / sous menus
     */
    protected function _init_role_rights() {
        $tabs = $this->_get_list_tabs_data();
        if (!empty($tabs)) {
            $subtabs = $this->_get_list_subtabs_data();
            foreach ($tabs as $section_label=>$sections_tabs) {
                foreach ($sections_tabs as $tab) {
                    $tab['section_label'] = $section_label;
                    $tab['subtabs'] = [];
                    $label_code = $tab['label_code'];
                    if (!empty($subtabs[$label_code])) {
                        foreach ($subtabs[$label_code] as $subtab) {
                            $tab['subtabs'][] = $subtab;
                        }
                    }
                    $this->add_object($tab);
                }
            }
        }
    }
	
	protected function init_default_settings() {
	    parent::init_default_settings();
	    $this->set_setting_display('grouped_objects', 'sort', false);
	}
}