Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
theme_config Class Reference

This class represents the configuration variables of a Moodle theme. More...

Public Member Functions

 css_urls (moodle_page $page)
 Get the stylesheet URL of this theme.
 
 editor_css_files ()
 Returns the content of the CSS to be used in editor content.
 
 editor_css_url ($encoded=true)
 Returns the stylesheet URL of this editor content.
 
 editor_scss_to_css ()
 Compiles and returns the content of the SCSS to be used in editor content.
 
 font_url ($font, $component)
 Return the URL for a font.
 
 force_svg_use ($setting)
 Forces the usesvg setting to either true or false, avoiding any decision making.
 
 get_all_block_regions ()
 Get the list of all block regions known to this theme in all templates.
 
 get_block_render_method ()
 Returns the block render method.
 
 get_css_cache_key ()
 Generate the css content cache key.
 
 get_css_cached_content ()
 Return cached post processed CSS content.
 
 get_css_content ()
 Get the whole css stylesheet for production mode.
 
 get_css_content_debug ($type, $subtype, $sheet)
 Get the theme designer css markup, the parameters are coming from css_urls().
 
 get_css_content_editor ()
 Get the whole css stylesheet for editor iframe.
 
 get_css_tree_post_processor ()
 Get the callable for CSS tree post processing.
 
 get_extra_scss_code ()
 Return extra SCSS code to add when compiling.
 
 get_icon_system ()
 Get the icon system to use.
 
 get_pre_scss_code ()
 SCSS code to prepend when compiling.
 
 get_precompiled_css_content ()
 Return the precompiled CSS if the precompiledcsscallback exists.
 
 get_renderer (moodle_page $page, $component, $subtype=null, $target=null)
 Get the renderer for a part of Moodle for this theme.
 
 get_rtl_mode ()
 Whether the theme is being served in RTL mode.
 
 get_scss_property ()
 Get the SCSS property.
 
 get_theme_name ()
 Returns the human readable name of the theme.
 
 has_css_cached_content ()
 Return whether the post processed CSS content has been cached.
 
 image_url ($imagename, $component)
 Return the direct URL for an image from the pix folder.
 
 init_page (moodle_page $page)
 Let the theme initialise the page object (usually $PAGE).
 
 javascript_content ($type)
 Returns the content of the one huge javascript file merged from all theme javascript files.
 
 javascript_files ($type)
 Get the URL's for the JavaScript files used by this theme.
 
 javascript_url ($inhead)
 Generate a URL to the file that serves theme JavaScript files.
 
 layout_file ($pagelayout)
 Given the settings of this theme, and the page pagelayout, return the full path of the page layout file to use.
 
 pagelayout_options ($pagelayout)
 Returns auxiliary page layout options specified in layout configuration array.
 
 pix_url ($imagename, $component)
 Return the direct URL for an image from the pix folder.
 
 post_process ($css)
 Post processes CSS.
 
 renderer_prefixes ()
 Returns output renderer prefixes, these are used when looking for the overridden renderers in themes.
 
 resolve_font_location ($font, $component)
 Resolves the real font location.
 
 resolve_image_location ($image, $component, $svg=false)
 Resolves the real image location.
 
 set_css_content_cache ($csscontent)
 Set post processed CSS content cache.
 
 set_rtl_mode ($inrtl=true)
 Set to be in RTL mode.
 
 setting_file_serve ($filearea, $args, $forcedownload, $options)
 Serve the theme setting file.
 
 setting_file_url ($setting, $filearea)
 Returns URL to the stored file via pluginfile.php.
 
 setup_blocks ($pagelayout, $blockmanager)
 Inform a block_manager about the block regions this theme wants on this page layout.
 
 supports_source_maps ($themedesigner)
 Checks if source maps are supported.
 
 use_svg_icons ()
 Return true if we should look for SVG images as well.
 

Static Public Member Functions

static diagnose ($themename)
 Theme diagnostic code.
 
static load ($themename)
 Load the config.php file for a particular theme, and return an instance of this class.
 

Public Attributes

array $activityheaderconfig = []
 Configuration for the page activity header.
 
int $addblockposition
 For backward compatibility with old themes.
 
string $blockrendermethod = null
 Sets the render method that should be used for rendering custom block regions by scripts such as my/index.php Defaults to core_renderer::blocks_for_region().
 
array $blockrtlmanipulations = array()
 An associative array of block manipulations that should be made if the user is using an rtl language.
 
string $csspostprocess = null
 Function to do custom CSS post-processing.
 
string $csstreepostprocessor = null
 Function to do custom CSS post-processing on a parsed CSS tree.
 
string $darrow = null
 Accessibility: Down arrow-like character.
 
string $dir
 The folder where this themes files are stored.
 
string $doctype = 'html5'
 Determines served document types.
 
array $editor_scss
 editor_scss file(s) provided by this theme.
 
array $editor_sheets = array()
 List of style sheets that are included in the text editor bodies.
 
bool $enable_dock = false
 If set to true and the theme enables the dock then blocks will be able to be moved to the special dock.
 
bool $enablecourseajax = true
 Some themes may want to disable ajax course editing.
 
string $extrascsscallback = null
 The name of the function to call to get the SCSS code to inject.
 
bool $haseditswitch = false
 Theme defines its own editing mode switch.
 
bool $hidefromselector = false
 If set to true then this theme will not be shown in the theme selector unless theme designer mode is turned on.
 
string $iconsystem
 Name of the class extending core\output\icon_system.
 
array $javascripts = array()
 The names of all the javascript files this theme that you would like included from head, in order.
 
array $javascripts_footer = array()
 The names of all the javascript files this theme that you would like included from footer, in order.
 
string $larrow = null
 Accessibility: Left arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block.
 
array $layouts = array()
 Which file to use for each page layout.
 
string $name
 The name of this theme.
 
array $parents
 You can base your theme on other themes by linking to the other theme as parents.
 
array $parents_exclude_javascripts = null
 The names of all the javascript files from parents that should be excluded.
 
array $parents_exclude_sheets = null
 The names of all the stylesheets from parents that should be excluded.
 
array $plugins_exclude_sheets = null
 List of plugin sheets to be excluded.
 
string $precompiledcsscallback = null
 The name of the function to call to get precompiled CSS.
 
string $prescsscallback = null
 The name of the function to call to get SCSS to prepend.
 
string $rarrow = null
 Accessibility: Right arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block.
 
array $remapiconcache = []
 Remember the results of icon remapping for the current page.
 
array $removedprimarynavitems = []
 Allows a theme to customise primary navigation by specifying the list of items to remove.
 
string $rendererfactory = 'standard_renderer_factory'
 Name of the renderer factory class to use.
 
string $requiredblocks = false
 requiredblocks If set to a string, will list the block types that cannot be deleted.
 
string Closure $scss = false
 The SCSS file to compile (without .scss), located in the scss/ folder of the theme.
 
stdClass $settings = null
 Theme settings stored in config_plugins table.
 
array $sheets = array()
 The names of all the stylesheets from this theme that you would like included, in order.
 
string $uarrow = null
 Accessibility: Up arrow-like character is used in the book heirarchical navigation.
 
bool $usefallback = false
 Whether a fallback version of the stylesheet will be used whilst the final version is generated.
 
bool $usescourseindex = false
 Whether the theme uses course index.
 
array $yuicssmodules = array('cssreset', 'cssfonts', 'cssgrids', 'cssbase')
 list of YUI CSS modules to be included on each page.
 
string const DEFAULT_THEME = 'boost'
 Default theme, used when requested theme not found.
 
const SCSS_KEY = '__SCSS__'
 The key under which the SCSS file is stored amongst the CSS files.
 

Protected Member Functions

 get_css_content_from_scss ($themedesigner)
 Return the CSS content generated from the SCSS file.
 
 get_css_files ($themedesigner)
 Returns an array of organised CSS files required for this output.
 
 get_region_name ($region, $theme)
 Gets the visible name for the requested block region.
 
 layout_info_for_page ($pagelayout)
 Get the information from $layouts for this type of page.
 
 resolve_excludes ($variable, $default=null)
 Resolves an exclude setting to the themes setting is applicable or the setting of its closest parent.
 
 rtlize ($csstree)
 Flip a stylesheet to RTL.
 

Protected Attributes

array $parent_configs = array()
 List of parent config objects.
 
renderer_factory $rf = null
 Instance of the renderer_factory implementation we are using.
 
bool $rtlmode = false
 Whether in RTL mode or not.
 
false array $scsscache = null
 Local cache of the SCSS property.
 

Detailed Description

This class represents the configuration variables of a Moodle theme.

All the variables with access: public below (with a few exceptions that are marked) are the properties you can set in your themes config.php file.

There are also some methods and protected variables that are part of the inner workings of Moodle's themes system. If you are just editing a themes config.php file, you can just ignore those, and the following information for developers.

Normally, to create an instance of this class, you should use the theme_config::load() factory method to load a themes config.php file. However, normally you don't need to bother, because moodle_page (that is, $PAGE) will create one for you, accessible as $PAGE->theme.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 2.0

Member Function Documentation

◆ css_urls()

theme_config::css_urls ( moodle_page $page)

Get the stylesheet URL of this theme.

Parameters
moodle_page$pageNot used... deprecated?
Return values
moodle_url[]

◆ diagnose()

static theme_config::diagnose ( $themename)
static

Theme diagnostic code.

It is very problematic to send debug output to the actual CSS file, instead this functions is supposed to diagnose given theme and highlights all potential problems. This information should be available from the theme selection page or some other debug page for theme designers.

Parameters
string$themename
Return values
arraydescription of problems

◆ editor_css_files()

theme_config::editor_css_files ( )

Returns the content of the CSS to be used in editor content.

Return values
array

◆ editor_css_url()

theme_config::editor_css_url ( $encoded = true)

Returns the stylesheet URL of this editor content.

Parameters
bool$encodedfalse means use & and true use & in URLs
Return values
moodle_url

◆ editor_scss_to_css()

theme_config::editor_scss_to_css ( )

Compiles and returns the content of the SCSS to be used in editor content.

Return values
stringCompiled CSS from the editor SCSS

◆ font_url()

theme_config::font_url ( $font,
$component )

Return the URL for a font.

Parameters
string$fontthe name of the font (including extension).
string$componentspecification of one plugin like in get_string()
Return values
moodle_url

◆ force_svg_use()

theme_config::force_svg_use ( $setting)

Forces the usesvg setting to either true or false, avoiding any decision making.

This function should only ever be used when absolutely required, and before any generation of image URL's has occurred. DO NOT ABUSE THIS FUNCTION... not that you'd want to right ;)

Parameters
bool$settingTrue to force the use of svg when available, null otherwise.

◆ get_all_block_regions()

theme_config::get_all_block_regions ( )

Get the list of all block regions known to this theme in all templates.

Return values
arrayinternal region name => human readable name.

◆ get_block_render_method()

theme_config::get_block_render_method ( )

Returns the block render method.

It is set by the theme via: $THEME->blockrendermethod = '...';

It can be one of two values, blocks or blocks_for_region. It should be set to the method being used by the theme layouts.

Return values
string

◆ get_css_cache_key()

theme_config::get_css_cache_key ( )

Generate the css content cache key.

Return values
stringThe post processed css cache key.

◆ get_css_cached_content()

theme_config::get_css_cached_content ( )

Return cached post processed CSS content.

Return values
bool|stringThe cached css content or false if not found.

◆ get_css_content()

theme_config::get_css_content ( )

Get the whole css stylesheet for production mode.

NOTE: this method is not expected to be used from any addons.

Return values
stringCSS markup compressed

◆ get_css_content_debug()

theme_config::get_css_content_debug ( $type,
$subtype,
$sheet )

Get the theme designer css markup, the parameters are coming from css_urls().

NOTE: this method is not expected to be used from any addons.

Parameters
string$type
string$subtype
string$sheet
Return values
stringCSS markup

◆ get_css_content_editor()

theme_config::get_css_content_editor ( )

Get the whole css stylesheet for editor iframe.

NOTE: this method is not expected to be used from any addons.

Return values
stringCSS markup

◆ get_css_content_from_scss()

theme_config::get_css_content_from_scss ( $themedesigner)
protected

Return the CSS content generated from the SCSS file.

Parameters
bool$themedesignerTrue if theme designer is enabled.
Return values
bool|stringReturn false when the compilation failed. Else the compiled string.

◆ get_css_files()

theme_config::get_css_files ( $themedesigner)
protected

Returns an array of organised CSS files required for this output.

Parameters
bool$themedesigner
Return values
arraynested array of file paths

◆ get_css_tree_post_processor()

theme_config::get_css_tree_post_processor ( )

Get the callable for CSS tree post processing.

Return values
string|null

◆ get_extra_scss_code()

theme_config::get_extra_scss_code ( )

Return extra SCSS code to add when compiling.

This is intended to be used by themes to inject some SCSS code before it gets compiled. If you want to inject variables you should use self::get_scss_variables().

Return values
stringThe SCSS code to inject.

◆ get_icon_system()

theme_config::get_icon_system ( )

Get the icon system to use.

Return values
string

◆ get_pre_scss_code()

theme_config::get_pre_scss_code ( )

SCSS code to prepend when compiling.

This is intended to be used by themes to inject SCSS code before it gets compiled.

Return values
stringThe SCSS code to inject.

◆ get_precompiled_css_content()

theme_config::get_precompiled_css_content ( )

Return the precompiled CSS if the precompiledcsscallback exists.

Return values
stringReturn compiled css.

◆ get_region_name()

theme_config::get_region_name ( $region,
$theme )
protected

Gets the visible name for the requested block region.

Parameters
string$regionThe region name to get
string$themeThe theme the region belongs to (may come from the parent theme)
Return values
string

◆ get_renderer()

theme_config::get_renderer ( moodle_page $page,
$component,
$subtype = null,
$target = null )

Get the renderer for a part of Moodle for this theme.

Parameters
moodle_page$pagethe page we are rendering
string$componentthe name of part of moodle. E.g. 'core', 'quiz', 'qtype_multichoice'.
string$subtypeoptional subtype such as 'news' resulting to 'mod_forum_news'
string$targetone of rendering target constants
Return values
renderer_basethe requested renderer.

◆ get_rtl_mode()

theme_config::get_rtl_mode ( )

Whether the theme is being served in RTL mode.

Return values
boolTrue when in RTL mode.

◆ get_scss_property()

theme_config::get_scss_property ( )

Get the SCSS property.

This resolves whether a SCSS file (or content) has to be used when generating the stylesheet for the theme. It will look at parents themes and check the SCSS properties there.

Return values
Falsewhen SCSS is not used. An array with the import paths, and the path to the SCSS file or Closure as second.

◆ get_theme_name()

theme_config::get_theme_name ( )

Returns the human readable name of the theme.

Return values
string

◆ has_css_cached_content()

theme_config::has_css_cached_content ( )

Return whether the post processed CSS content has been cached.

Return values
boolWhether the post-processed CSS is available in the cache.

◆ image_url()

theme_config::image_url ( $imagename,
$component )

Return the direct URL for an image from the pix folder.

Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template.

Parameters
string$imagenamethe name of the icon.
string$componentspecification of one plugin like in get_string()
Return values
moodle_url

◆ init_page()

theme_config::init_page ( moodle_page $page)

Let the theme initialise the page object (usually $PAGE).

This may be used for example to request jQuery in add-ons.

Parameters
moodle_page$page

◆ javascript_content()

theme_config::javascript_content ( $type)

Returns the content of the one huge javascript file merged from all theme javascript files.

Parameters
bool$type
Return values
string

◆ javascript_files()

theme_config::javascript_files ( $type)

Get the URL's for the JavaScript files used by this theme.

They won't be served directly, instead they'll be mediated through theme/javascript.php.

Parameters
string$typeEither javascripts_footer, or javascripts
Return values
array

◆ javascript_url()

theme_config::javascript_url ( $inhead)

Generate a URL to the file that serves theme JavaScript files.

If we determine that the theme has no relevant files, then we return early with a null value.

Parameters
bool$inheadtrue means head url, false means footer
Return values
moodle_url|null

◆ layout_file()

theme_config::layout_file ( $pagelayout)

Given the settings of this theme, and the page pagelayout, return the full path of the page layout file to use.

Used by core_renderer::header().

Parameters
string$pagelayoutthe the page layout name.
Return values
stringFull path to the lyout file to use

◆ layout_info_for_page()

theme_config::layout_info_for_page ( $pagelayout)
protected

Get the information from $layouts for this type of page.

Parameters
string$pagelayoutthe the page layout name.
Return values
arraythe appropriate part of $layouts.

◆ load()

static theme_config::load ( $themename)
static

Load the config.php file for a particular theme, and return an instance of this class.

(That is, this is a factory method.)

Parameters
string$themenamethe name of the theme.
Return values
theme_configan instance of this class.

◆ pagelayout_options()

theme_config::pagelayout_options ( $pagelayout)

Returns auxiliary page layout options specified in layout configuration array.

Parameters
string$pagelayout
Return values
array

◆ pix_url()

theme_config::pix_url ( $imagename,
$component )

Return the direct URL for an image from the pix folder.

Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template.

Deprecated
since Moodle 3.3
Parameters
string$imagenamethe name of the icon.
string$componentspecification of one plugin like in get_string()
Return values
moodle_url

◆ post_process()

theme_config::post_process ( $css)

Post processes CSS.

This method post processes all of the CSS before it is served for this theme. This is done so that things such as image URL's can be swapped in and to run any specific CSS post process method the theme has requested. This allows themes to use CSS settings.

Parameters
string$cssThe CSS to process.
Return values
stringThe processed CSS.

◆ renderer_prefixes()

theme_config::renderer_prefixes ( )

Returns output renderer prefixes, these are used when looking for the overridden renderers in themes.

Return values
array

◆ resolve_excludes()

theme_config::resolve_excludes ( $variable,
$default = null )
protected

Resolves an exclude setting to the themes setting is applicable or the setting of its closest parent.

Parameters
string$variableThe name of the setting the exclude setting to resolve
string$default
Return values
mixed

◆ resolve_font_location()

theme_config::resolve_font_location ( $font,
$component )

Resolves the real font location.

Parameters
string$fontname of font file
string$component
Return values
stringfull file path

◆ resolve_image_location()

theme_config::resolve_image_location ( $image,
$component,
$svg = false )

Resolves the real image location.

$svg was introduced as an arg in 2.4. It is important because not all supported browsers support the use of SVG and we need a way in which to turn it off. By default SVG won't be used unless asked for. This is done for two reasons:

  1. It ensures that we don't serve svg images unless we really want to. The admin has selected to force them, of the users browser supports SVG.
  2. We only serve SVG images from locations we trust. This must NOT include any areas where the image may have been uploaded by the user due to security concerns.
Parameters
string$imagename of image, may contain relative path
string$component
bool$svg,|nullShould SVG images also be looked for? If null, resorts to $CFG->svgicons if that is set; falls back to auto-detection of browser support otherwise
Return values
stringfull file path

◆ rtlize()

theme_config::rtlize ( $csstree)
protected

Flip a stylesheet to RTL.

Parameters
Object$csstreeThe parsed CSS tree structure to flip.
Return values
void

◆ set_css_content_cache()

theme_config::set_css_content_cache ( $csscontent)

Set post processed CSS content cache.

Parameters
string$csscontentThe post processed CSS content.
Return values
boolTrue if the content was successfully cached.

◆ set_rtl_mode()

theme_config::set_rtl_mode ( $inrtl = true)

Set to be in RTL mode.

This will likely be used when post processing the CSS before serving it.

Parameters
bool$inrtlTrue when in RTL mode.

◆ setting_file_serve()

theme_config::setting_file_serve ( $filearea,
$args,
$forcedownload,
$options )

Serve the theme setting file.

Parameters
string$filearea
array$args
bool$forcedownload
array$options
Return values
boolmay terminate if file not found or donotdie not specified

◆ setting_file_url()

theme_config::setting_file_url ( $setting,
$filearea )

Returns URL to the stored file via pluginfile.php.

Note the theme must also implement pluginfile.php handler, theme revision is used instead of the itemid.

Parameters
string$setting
string$filearea
Return values
stringprotocol relative URL or null if not present

◆ setup_blocks()

theme_config::setup_blocks ( $pagelayout,
$blockmanager )

Inform a block_manager about the block regions this theme wants on this page layout.

Parameters
string$pagelayoutthe general type of the page.
block_manager$blockmanagerthe block_manger to set up.

◆ supports_source_maps()

theme_config::supports_source_maps ( $themedesigner)

Checks if source maps are supported.

Parameters
bool$themedesignerTrue if theme designer is enabled.
Return values
booleanTrue if source maps are supported.

◆ use_svg_icons()

theme_config::use_svg_icons ( )

Return true if we should look for SVG images as well.

Return values
bool

Member Data Documentation

◆ $addblockposition

int theme_config::$addblockposition

For backward compatibility with old themes.

BLOCK_ADDBLOCK_POSITION_DEFAULT, BLOCK_ADDBLOCK_POSITION_FLATNAV.

◆ $blockrtlmanipulations

array theme_config::$blockrtlmanipulations = array()

An associative array of block manipulations that should be made if the user is using an rtl language.

The key is the original block region, and the value is the block region to change to. This is used when displaying blocks for regions only.

◆ $csspostprocess

string theme_config::$csspostprocess = null

Function to do custom CSS post-processing.

This is an advanced feature. If you want to do custom post-processing on the CSS before it is output (for example, to replace certain variable names with particular values) you can give the name of a function here.

◆ $csstreepostprocessor

string theme_config::$csstreepostprocessor = null

Function to do custom CSS post-processing on a parsed CSS tree.

This is an advanced feature. If you want to do custom post-processing on the CSS before it is output, you can provide the name of the function here. The function will receive a CSS tree document as first parameter, and the theme_config object as second parameter. A return value is not required, the tree can be edited in place.

◆ $darrow

string theme_config::$darrow = null

Accessibility: Down arrow-like character.

If the theme does not set characters, appropriate defaults are set automatically.

◆ $dir

string theme_config::$dir

The folder where this themes files are stored.

This is set automatically. This can not be set in theme config.php

◆ $doctype

string theme_config::$doctype = 'html5'

Determines served document types.

  • 'html5' the only officially supported doctype in Moodle
  • 'xhtml5' may be used in development for validation (not intended for production servers!)
  • 'xhtml' XHTML 1.0 Strict for legacy themes only

◆ $editor_sheets

array theme_config::$editor_sheets = array()

List of style sheets that are included in the text editor bodies.

Sheets from parent themes are used automatically and can not be excluded.

◆ $javascripts

array theme_config::$javascripts = array()

The names of all the javascript files this theme that you would like included from head, in order.

Give the names of the files without .js.

◆ $javascripts_footer

array theme_config::$javascripts_footer = array()

The names of all the javascript files this theme that you would like included from footer, in order.

Give the names of the files without .js.

◆ $larrow

string theme_config::$larrow = null

Accessibility: Left arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block.

If the theme does not set characters, appropriate defaults are set automatically. Please DO NOT use < > » - these are confusing for blind users.

◆ $layouts

array theme_config::$layouts = array()

Which file to use for each page layout.

This is an array of arrays. The keys of the outer array are the different layouts. Pages in Moodle are using several different layouts like 'normal', 'course', 'home', 'popup', 'form', .... The most reliable way to get a complete list is to look at the base theme config.php file. That file also has a good example of how to set this setting.

For each layout, the value in the outer array is an array that describes how you want that type of page to look. For example

  $THEME->layouts = array(
      // Most pages - if we encounter an unknown or a missing page type, this one is used.
      'standard' => array(
          'theme' = 'mytheme',
          'file' => 'normal.php',
          'regions' => array('side-pre', 'side-post'),
          'defaultregion' => 'side-post'
      ),
      // The site home page.
      'home' => array(
          'theme' = 'mytheme',
          'file' => 'home.php',
          'regions' => array('side-pre', 'side-post'),
          'defaultregion' => 'side-post'
      ),
      // ...
  );

'theme' name of the theme where is the layout located 'file' is the layout file to use for this type of page. layout files are stored in layout subfolder 'regions' This lists the regions on the page where blocks may appear. For each region you list here, your layout file must include a call to

  echo $OUTPUT->blocks_for_region($regionname);

or equivalent so that the blocks are actually visible.

'defaultregion' If the list of regions is non-empty, then you must pick one of the one of them as 'default'. This has two meanings. First, this is where new blocks are added. Second, if there are any blocks associated with the page, but in non-existent regions, they appear here. (Imaging, for example, that someone added blocks using a different theme that used different region names, and then switched to this theme.)

◆ $name

string theme_config::$name

The name of this theme.

Set automatically when this theme is loaded. This can not be set in theme config.php

◆ $parents

array theme_config::$parents

You can base your theme on other themes by linking to the other theme as parents.

This lets you use the CSS and layouts from the other themes (see theme_config::$layouts). That makes it easy to create a new theme that is similar to another one but with a few changes. In this themes CSS you only need to override those rules you want to change.

◆ $parents_exclude_javascripts

array theme_config::$parents_exclude_javascripts = null

The names of all the javascript files from parents that should be excluded.

true value may be used to specify all parents or all themes from one parent. If no value specified value from parent theme used.

◆ $parents_exclude_sheets

array theme_config::$parents_exclude_sheets = null

The names of all the stylesheets from parents that should be excluded.

true value may be used to specify all parents or all themes from one parent. If no value specified value from parent theme used.

◆ $plugins_exclude_sheets

array theme_config::$plugins_exclude_sheets = null

List of plugin sheets to be excluded.

If no value specified value from parent theme used.

◆ $rarrow

string theme_config::$rarrow = null

Accessibility: Right arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block.

If the theme does not set characters, appropriate defaults are set automatically. Please DO NOT use < > » - these are confusing for blind users.

◆ $rendererfactory

string theme_config::$rendererfactory = 'standard_renderer_factory'

Name of the renderer factory class to use.

Must implement the renderer_factory interface.

This is an advanced feature. Moodle output is generated by 'renderers', you can customise the HTML that is output by writing custom renderers, and then you need to specify 'renderer factory' so that Moodle can find your renderers.

There are some renderer factories supplied with Moodle. Please follow these links to see what they do.

◆ $requiredblocks

string theme_config::$requiredblocks = false

requiredblocks If set to a string, will list the block types that cannot be deleted.

Defaults to navigation and settings.

◆ $rf

renderer_factory theme_config::$rf = null
protected

Instance of the renderer_factory implementation we are using.

Implementation detail.

◆ $scss

string Closure theme_config::$scss = false

The SCSS file to compile (without .scss), located in the scss/ folder of the theme.

Or a Closure, which receives the theme_config as argument and must return the SCSS content.

◆ $settings

stdClass theme_config::$settings = null

Theme settings stored in config_plugins table.

This can not be set in theme config.php

◆ $sheets

array theme_config::$sheets = array()

The names of all the stylesheets from this theme that you would like included, in order.

Give the names of the files without .css.

◆ $uarrow

string theme_config::$uarrow = null

Accessibility: Up arrow-like character is used in the book heirarchical navigation.

If the theme does not set characters, appropriate defaults are set automatically. Please DO NOT use ^ - this is confusing for blind users.

◆ $yuicssmodules

array theme_config::$yuicssmodules = array('cssreset', 'cssfonts', 'cssgrids', 'cssbase')

list of YUI CSS modules to be included on each page.

This may be used to remove cssreset and use cssnormalise module instead.


The documentation for this class was generated from the following file: