<?php
// +-------------------------------------------------+
// 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: event_selector_tabs.class.php,v 1.1.2.1 2026/07/10 13:28:25 qvarin Exp $

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

require_once $class_path.'/event/event.class.php';

/**
 * Event permettant aux plugins d'ajouter des tabs supplementaires
 * a un selecteur (voir selector_model::get_default_parameters_tabs()).
 */
class event_selector_tabs extends event {

    protected $selector_model;

    protected $plugin_tabs = [];

    /**
     * @param selector_model $selector_model
     */
    public function set_selector_model(selector_model $selector_model): void {
        $this->selector_model = $selector_model;
    }

    /**
     * @return selector_model
     */
    public function get_selector_model(): selector_model {
        return $this->selector_model;
    }

    /**
     * @param string $name
     * @param array $options
     */
    public function add_sub_tab(string $name, array $options): void {
        $this->plugin_tabs[$name] = $options;
    }

    /**
     * @return array
     */
    public function get_plugin_tabs(): array {
        return $this->plugin_tabs;
    }
}
