ETS System
Relevant source files
The following files were used as context for generating this wiki page:The ETS System is a web page component within the "inside institute itech" section of the website. It is served by the inside/ets.php script and is responsible for rendering content related to "ETS". The system features a server-side rendering pipeline using PHP, supports multiple languages through session management and JSON translation files, and integrates with the site's global layout and client-side scripts for a consistent user experience.
Page Loading and Rendering
The core logic for the ETS page resides in inside/ets.php. When a user requests this page, the script executes a standard procedure to assemble and return the final HTML document. This involves starting a session, handling language preferences, loading page-specific configurations, rendering a content template (ets.phtml), and embedding it within a master layout file.
The diagram below illustrates the server-side rendering flow for the ETS page.
Sources: inside/ets.php
Internationalization (i18n)
The ETS system supports multiple languages, managed through PHP sessions and configuration files.
Language Detection and Management
Language preference is handled at the beginning of the script execution in inside/ets.php.
- Session Start: A PHP session is initiated with
session_start(). - URL Parameter Check: The script checks for a
langGET parameter in the URL (e.g.,/inside/ets.php?lang=en). - Session Update: If
langis present, its value is stored in$_SESSION['lang']. The user is then redirected to the same URL without the query parameter to provide a clean address. - Language Fallback: If no language is set in the session, it defaults to Italian (
it).
Sources: inside/ets.php:2-10
Translation Sources
Text content is sourced from two main files:
apps/pages.php: Defines the<title>tag for the HTML page. The keyinside_etsis used for the ETS page.apps/translations.json: Contains a key-value store for UI text across the site. The ETS page has a corresponding navigation link defined by the keynavbar_secondary_inside_ets_overview.
A helper function t($key) is available within the script's scope to retrieve the correct translation string based on the current session language.
Sources: inside/ets.php:11-18, apps/pages.php:31-36, apps/translations.json:158-163
ETS-Related Translations
| Key | English Text | File |
|---|---|---|
inside_ets | ETS: Institute Itech | apps/pages.php |
navbar_secondary_inside_ets_overview | ETS Overview | apps/translations.json |
Sources: apps/pages.php:31-36, apps/translations.json:158-163
Client-Side Behavior
The ETS page has specific client-side behaviors defined in apps/js/iite_components.js. The primary modification is changing the color of the site logo.
Logo Color Adjustment
The script identifies a list of pages that require a black logo instead of the default white. The /inside/ets.php path is included in this list.
// Source: apps/js/iite_components.js:28-40
const whitePages = [
'/iite/company',
'/iite/wep',
'/iite/relationship',
'/departments/overview',
'/inside/overview',
'/inside/ets.php'
];
if (logo) {
const isWhite = whitePages.some(page => path.includes(page));
logo.style.color = isWhite ? 'black' : '#ffffff';
}
The following flowchart shows this client-side logic.
Sources: apps/js/iite_components.js:28-40
Page Configuration
The page title for the ETS system is configured in apps/pages.php for multiple languages. For the inside_ets key, the title is consistent across all defined languages.
| Language Code | Page Title |
|---|---|
it | ETS: Institute Itech |
en | ETS: Institute Itech |
fr | ETS: Institute Itech |
es | ETS: Institute Itech |
Sources: apps/pages.php:31-36