Html::nullHeader PHP Method

nullHeader() static public method

Print a nice HTML head with no controls
static public nullHeader ( $title, $url = '' )
$title title of the page
$url not used anymore (default '')
    static function nullHeader($title, $url = '')
    {
        global $CFG_GLPI, $HEADER_LOADED;
        if ($HEADER_LOADED) {
            return;
        }
        $HEADER_LOADED = true;
        // Print a nice HTML-head with no controls
        // Detect root_doc in case of error
        Config::detectRootDoc();
        // Send UTF8 Headers
        header("Content-Type: text/html; charset=UTF-8");
        // Send extra expires header if configured
        self::header_nocache();
        if (isCommandLine()) {
            return true;
        }
        self::includeHeader($title);
        // Body with configured stuff
        echo "<body>";
        echo "<div id='page'>";
        echo "<br><br>";
        echo "<div id='bloc'>";
        echo "<div id='logo_bloc'></div>";
    }

Usage Example

                $_SESSION['valid_id'] = session_id();
                $_SESSION['glpiactiveentities'] = $form->fields['entities_id'];
                $subentities = getSonsOf('glpi_entities', $form->fields['entities_id']);
                $_SESSION['glpiactiveentities_string'] = !empty($subentities) ? "'" . implode("', '", $subentities) . "'" : "'" . $form->fields['entities_id'] . "'";
            }
        }
        if (isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') {
            Html::helpHeader(__('Form list', 'formcreator'), $_SERVER['PHP_SELF']);
            $form->displayUserForm($form);
            Html::helpFooter();
        } elseif (!empty($_SESSION['glpiactiveprofile'])) {
            Html::header(__('Form Creator', 'formcreator'), $_SERVER['PHP_SELF'], 'helpdesk', 'PluginFormcreatorFormlist');
            $form->displayUserForm($form);
            Html::footer();
        } else {
            Html::nullHeader(__('Form Creator', 'formcreator'), $_SERVER['PHP_SELF']);
            Html::displayMessageAfterRedirect();
            $form->displayUserForm($form);
            Html::nullFooter();
        }
    } else {
        Html::displayNotFoundError();
    }
    // If user was not authenticated, remove temporary user
    if ($_SESSION['glpiname'] == 'formcreator_temp_user') {
        unset($_SESSION['glpiname']);
    }
    // Or display a "Not found" error
} else {
    Html::displayNotFoundError();
}
All Usage Examples Of Html::nullHeader
Html