Html::showProfileSelecter PHP Method

showProfileSelecter() static public method

Print the form used to select profile if several are available
static public showProfileSelecter ( $target ) : nothing
$target target of the form
return nothing
    static function showProfileSelecter($target)
    {
        global $CFG_GLPI;
        if (count($_SESSION["glpiprofiles"]) > 1) {
            echo '<li class="profile-selector"><form name="form" method="post" action="' . $target . '">';
            $values = array();
            foreach ($_SESSION["glpiprofiles"] as $key => $val) {
                $values[$key] = $val['name'];
            }
            Dropdown::showFromArray('newprofile', $values, array('value' => $_SESSION["glpiactiveprofile"]["id"], 'width' => '150px', 'on_change' => 'submit()'));
            Html::closeForm();
            echo '</li>';
        }
        if (Session::isMultiEntitiesMode()) {
            echo "<li class='profile-selector'>";
            Ajax::createModalWindow('entity_window', $CFG_GLPI['root_doc'] . "/ajax/entitytree.php", array('title' => __('Select the desired entity'), 'extraparams' => array('target' => $target)));
            echo "<a onclick='entity_window.dialog(\"open\");' href='#modal_entity_content' title=\"" . addslashes($_SESSION["glpiactive_entity_name"]) . "\" class='entity_select' id='global_entity_select'>" . $_SESSION["glpiactive_entity_shortname"] . "</a>";
            echo "</li>";
        }
    }
Html