Unofficial SMF API Documentation

./Sources/Themes.php

ThemesMain

function ThemesMain(): void

Subaction handler - manages the action and delegates control to the proper sub-action.

It loads both the Themes and Settings language files. Checks the session by GET or POST to verify the sent data. Requires the user not be a guest. (@todo what?) Accessed via ?action=admin;area=theme.

Integration hooks
integrate_manage_themes

ThemeAdmin

function ThemeAdmin(): void

This function allows administration of themes and their settings, as well as global theme settings.

Uses Themes template Uses Admin language file

ThemeList

function ThemeList(): void

This function lists the available themes and provides an interface to reset the paths of all the installed themes.

SetThemeOptions

function SetThemeOptions(): void

Administrative global settings.

Integration hooks
integrate_theme_options

SetThemeSettings

function SetThemeSettings(): void

Administrative global settings.

Integration hooks
integrate_theme_settings

RemoveTheme

function RemoveTheme(): void

Remove a theme from the database.

EnableTheme

function EnableTheme(): void

Handles enabling/disabling a theme from the admin center

canPickTheme

function canPickTheme(int $id_member, int $id_theme): bool

Determines if a user can change their theme.

Type Parameter Description
int $id_member  
int $id_theme  

PickTheme

function PickTheme(): void

Choose a theme from a list.

allows a user to pick a new theme with an interface.

ThemeInstall

function ThemeInstall(): void

Installs new themes, calls the respective function according to the install type.

InstallFile

function InstallFile(): array

Installs a theme from a theme package.

Stores the theme files on a temp dir, on success it renames the dir to the new theme’s name. Ends execution with fatal_lang_error() on any error.

InstallCopy

function InstallCopy(): array

Makes a copy from the default theme, assigns a name for it and installs it.

Creates a new .xml file containing all the theme’s info.

InstallDir

function InstallDir(): array

Install a theme from a specific dir

Assumes the dir is located on the main Themes dir. Ends execution with fatal_lang_error() on any error.

WrapAction

function WrapAction(): void

Possibly the simplest and best example of how to use the template system.

Integration hooks
integrate_wrap_action

SetJavaScript

function SetJavaScript(): void

Set an option via javascript.

EditTheme

function EditTheme(): void

Shows an interface for editing the templates.

CopyTemplate

function CopyTemplate(): void

Makes a copy of a template file in a new location

Suggest an edit to this page on GitHub