Variables - gtbu/Typesetter5.2 GitHub Wiki

  1. Use `global $variable_name;` in your functions to access them. ###

Common Variables

Variable Name Type Description
$config array Array of the CMS main configuration
$dataDir string Absolute file system path to your Typesetter installation.
Usually sth. like ‘/var/www/html’ or ‘/home/user234/www’
$dirPrefix string Subdirectory/subdirecories part of the Typesetter installation relative to the webhosts Document Root. If Typesetter is installed in a subdirecory, e.g.  ‘/var/www/html/Typesetter/Test/[cms files here]’ and the web URL is ‘http://my.domain.name/Typesetter/Test’, $dirPrefix will be ‘Typesetter/Test’. Empty if installed in the Document Root.
$get_all_gadgets_called boolean Indicates if \gp\tool\Output::GetAllGadgets() was called, usually in template.php
$gpAdmin array Array of information about the current logged-in user. NULL if not logged-in.
$gp_admin_html string HTML of all of Typesetter’s Admin UI elements. NULL if not logged-in.
$GP_ARRANGE boolean true if a menu can be moved or deleted in a theme using Layout Editor. Normally false by default in most themes in order to prevent accidential deletion of the main navigation. See template.php of your theme.
$GP_GETALLGADGETS boolean Normally used in a theme’s settings.php file to define if all available Gadgets should be loaded by default.
$gp_index array Array of page titles as keys and page indexes as values. Sth. like …
array(
‘Home’ => ‘a’,
‘About’ => ‘b’,
‘Child_Page’ => ‘c’,
‘Site_Map’ => ‘special_site_map’,
[…]
)
$gpLayouts array Array of information about currently installed Layouts
$gp_menu array

Array of page indexes and levels in the Main Menu. Sth. like …

array( 
‘a’ => array( ‘level’ => ‘0’ ),
‘b’ => array( ‘level’ => ‘0’ ),
‘c’ => array( ‘level’ => ‘1’ ),
[…]
)
$GP_MENU_CLASS string CSS class name of a menu’s topmost <ul> element. Defaults to ‘menu_top’ but is usually overridden by Bootstrap-based themes. Only available late, when template.php is processed.
$GP_MENU_CLASSES array Array that defines CSS class name for a menu’s html elements (<ul>, <li> and <a> tags). Normally only used in template.php prior to menu output.
$GP_MENU_LINKS string Used for link formatting in menus. Defaults to
<a href=“{$href_text}” title=“{$title}”{$attr}>{$label}
but can be overridden in template.php, e.g. in order to prevent rendering title attributes.
$gp_not_writable array Array of not writable files. Used for error message output.
$gpOutConf array Array with information about available menu configurations.
$gp_titles array

Array with information about all (non-admin) pages’ indexes, labels, types, layouts and visibility. Looks like …

array(
‘a’ => array(
‘label’ => ‘Home’,
‘type’ => ‘text’
),
‘b’ => array(
‘label’ => ‘About’,
‘type’ => ‘text’
),
[…],
‘f’ => array(
‘label’ => ‘Hidden’,
‘type’ => ‘text’,
‘vis’ => ‘private’
),
‘special_contact’ => array(
‘type’ => ‘special’,
‘label’ => ‘Contact’
),
[…]
)
$langmessage array Predefined terms in the configured user interface language.
$languages array Available languages Typesetter has a translation for.
$linkPrefix string Similar to $dirPrefix when Typesetter is installed in a subdirectory.
Contains ‘/index.php’ if URL rewriting (see Settings ⇒ Permalinks) is disabled or unavailable.
$page object See The $page object
$wbMessageBuffer array Array of messages to be shown in the yellow slide-down message bar.
⚠️ **GitHub.com Fallback** ⚠️