Deployment Guide
Relevant source files
The following files were used as context for generating this wiki page:This guide provides a comprehensive overview of the project's structure and the necessary steps for manual deployment and configuration. The application is a classic PHP website that relies on a specific file structure for routing and rendering, augmented with client-side JavaScript for dynamic behavior.
The provided source files do not contain any automated deployment scripts, container configurations (like Docker), or package management files with listed dependencies. Therefore, deployment is a manual process involving setting up a PHP-capable web server and placing the project files in the correct web root directory.
Project Architecture
The application follows a file-based routing and rendering pattern. The core structure consists of PHP "controller" files at the root of different directories (e.g., /iite/, /departments/), which are responsible for including corresponding .phtml template files and a global layout.
This diagram illustrates the high-level directory and file structure.
Server-Side Rendering
The server-side logic is handled by individual PHP files that act as entry points for different pages. These files follow a consistent pattern for rendering content within a master layout.
Request Handling Flow
When a user requests a page like /iite/overview.php, the server executes this PHP file directly. The script then performs the following steps:
- Starts a PHP session.
- Handles language selection via URL parameters (
?lang=en). - Defines the page title using a translations array.
- Uses output buffering (
ob_start()) to capture the HTML generated by a specific.phtmlview file. - Includes the main layout file (
layout.phtml), which then echoes the captured page content.
The following sequence diagram shows the rendering process for a page request.
Language and Page Titles
Page titles and other strings are managed through a centralized PHP array and a JSON file. The active language is stored in $_SESSION['lang'].
apps/pages.php: Contains a PHP array mapping page identifiers to their titles in multiple languages.apps/translations.json: A comprehensive JSON file with translation keys for UI elements across the site.t()function: A helper function in the PHP entry-point files to retrieve the correct translation string based on the current session language.
Sources: iite/overview.php:11-17, apps/pages.php, apps/translations.json
Client-Side Components
The file apps/js/iite_components.js manages significant client-side functionality, including navigation, dynamic styling, and user consent for cookies.
Client-Side Navigation
The application uses JavaScript to handle clicks on navigation elements, redirecting the user to the appropriate PHP page.
data-page Attribute | Destination URL |
|---|---|
iite | http://localhost |
insideiite | /inside/overview.php |
research | # |
departments | /departments/overview.php |
news | # |
inside | # |
| Sources: apps/js/iite_components.js:5-21 |
Dynamic Styling
JavaScript is used to dynamically alter the appearance of components based on the current page URL. For example, the color of the IITE logo is changed on specific pages.
// apps/js/iite_components.js:24-34
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';
}
Sources: apps/js/iite_components.js:24-34
Cookie Consent Management
A simple cookie consent banner is managed on the client side using localStorage to remember the user's choice.
This flowchart shows the logic for handling the cookie consent banner.
Sources: apps/js/iite_components.js:53-90
Styling and Theming
The visual appearance of the website is controlled by two main CSS files, which define a set of color variables, fonts, and layout rules.
themes/css/iite.css: Imports fonts and defines base styles for the body, typography, and UI components like the language switcher and cookie banner.themes/css/design.css: Defines the primary layout, navigation menus, grid systems, and specific page styles.
Key CSS Variables
The following variables are defined for consistent theming.
| Variable | Value | Description |
|---|---|---|
--static-background | #BFBFBF | A static background color. |
--navbar-background | #02274c | Background for the navigation bar. |
--w-white | white | Primary white color. |
--w-black | black | Primary black color. |
--w-grey | #e9e9e9 | A light grey for backgrounds. |
--w-blue | #0448d5 | Primary accent blue. |
--w-orange | #fc6d49 | Accent orange color. |
| Sources: themes/css/design.css:3-16, themes/css/iite.css:3-19 |
Summary
Deploying the oldwebsite project requires a manual setup on a web server with PHP support. The core of the application lies in its file-based routing system, where individual PHP files render content into a global template. Key server-side components include session management for language preferences and a translation system. On the client side, JavaScript handles navigation, dynamic styling, and user consent, complementing the server-rendered pages.