Core Render System - xoopscube/legacy GitHub Wiki

html/modules/legacyRender/kernel/Legacy_RenderSystem.class.php

XOOPSCube Legacy Render System Explained

The Legacy_RenderSystem is a core component of XOOPSCube Legacy that handles the rendering of all content displayed to users.
It's responsible for transforming data and templates into the final HTML output that users see in their browsers.

Key Features of the Render System

  1. Template-Based Rendering The system uses Smarty templates to separate presentation from business logic, making themes and layouts customizable without changing core code.

  2. Multi-Target Rendering The system can render different types of content:

    • Main content (page body)
    • Blocks (sidebars, headers, footers)
    • Themes (overall page layout)
    • Dialog boxes
  3. Variable Sharing Mechanism The system provides a way to share variables between different parts of the application through the Smarty template engine,
    making data accessible across templates.

  4. Legacy Compatibility It maintains backward compatibility with XOOPS 2.x themes and templates, allowing older themes to work with the newer XCube architecture.

  5. Delegate System The render system uses delegates (like mSetupXoopsTpl and mBeginRender) that allow modules to hook into the rendering process and modify it without changing core files.

  6. Meta Information Management It handles page metadata like title, keywords, description, and other meta tags, with support for social media tags and webmaster verification.

  7. Block Management The system manages the display of blocks in different positions (left, right, center) and determines their visibility based on module settings.

  8. Theme Integration It integrates with the theme system to apply the selected theme's styles and layouts to the rendered content.

  9. jQuery Integration The system includes support for jQuery and manages JavaScript inclusion in the page header.

  10. Caching Support Though not heavily used in the current implementation, the system has infrastructure for template caching to improve performance.

The render system is essentially the bridge between your application's data and the user interface, handling all aspects of how content is formatted and presented to users.