Class Window
Documentation of includes/core/window.class.php
Provides a comfortable, configurable styled Manialink window, with automatic handling of actions when a Player click on the pagination buttons.
Methods
setStyles
Setup the style of the Window.
Description
void = setStyles ( array $params )
Parameters
-
textcolorColor for the text in RGBA format, e.g.
09FF. -
backgroundcolorColor for the seperator at the header in RGBA format, e.g.
09FF. -
iconIcon for the header, choose one from the Manialink styles.
Example
// Setup the styles
$settings_style = array(
'textcolor' => '09FF',
'backgroundcolor' => 'FFFF',
'icon' => 'Icons64x64_1,ToolLeague1',
);
// Create the Window
$window = new Window();
$window->setStyles($settings_style);
setColumns
Setup the amount, width, alignment and text colors of the columns.
Description
void = setColumns ( array $params )
Parameters
-
columnsSetup the amount of outer columns the window should have, default is
1. -
widthsThe widths in percent of the inner columns of the
columns. -
halignAdjust the direction of each inner column, supported options are:
left(default),centerandright. -
textcolorsSetup for the inner columns text color, each inner column can have an own text color.
-
headingIf set, then each inner column will get a heading with the given title.
Example
$settings_columns = array(
'columns' => 2,
'widths' => array(25, 75),
'halign' => array('left', 'center'),
'textcolors' => array('FF5F', 'FFFF'),
'heading' => array('Command', 'Description'),
);
// Create the Window
$window = new Window();
$window->setColumns($settings_columns);
setContent
Setup the content of the title and the main content to display.
Description
void = setContent ( array $params )
Parameters
-
titleWindow title which will be shown right after the Icon.
-
modeMode for the window content, supported values are
columnsorpages. -
pageIf larger then
0, then that given page (if exists) will be showed instead of the first one. If the given number is larger then there are existing pages, the number will be reduced to the maximum page number. -
dataIn mode
columns: An array which each entry reflects a rows in a inner column.
In modepages: An array which each entry reflects a complete build manialink page which should be displayed inside the window. -
add_backgroundBoolean value: Include a background for
pages? Thecolumnswill get them by default!
Example
// Build the data
$data = array(
'/help', 'Display help',
'/plugins', 'Display Plugins',
'/players', 'Display Players',
'/list', 'Display Maps',
);
// Setup content
$settings_content = array(
'title' => 'Currently supported chat commands',
'data' => $data,
'mode' => 'columns',
);
// Create the Window
$window = new Window();
$window->setContent($settings_content);
setFooter
Setup the footer to display.
Description
void = setFooter ( array $params )
Parameters
-
about_titleTitle which will be shown at the buttom left.
-
about_linkLink for the
about_title, supported protocols aremanialink://http://https://ftp://ftps://ts3server://mumble://
-
button_titleTitle which will be shown at the center.
-
button_linkLink for the
button_title -
option_buttonAn array which contains a list of
button labelsand a valid link/action, supported protocols aremanialink://http://https://ftp://ftps://ts3server://mumble://
Example
$options = array();
$options[] = array('Show maplist filter window', 'PluginRecordsEyepiece?Action=showMaplistFilterWindow');
$options[] = array('Show maplist sorting window', 'PluginRecordsEyepiece?Action=showMaplistSortingWindow');
// Setup footer
$settings_footer = array(
'about_title' => 'MANIA-KARMA/'. $this->getVersion(),
'about_link' => 'http://www.mania-karma.com,
'button_title' => 'MORE INFO ON MANIA-KARMA.COM',
'button_link' => 'http://www.mania-karma.com/goto?uid='. $this->karma['data']['uid'],
'option_button' => $options,
);
// Create the Window
$window = new Window();
$window->setFooter($settings_footer);
send
Build, store and send the Window to the Player.
Description
void = send ( Class Player object $player, int $timeout, boolean $hideclick )
Parameters
-
$playerClass Player object
-
$timeoutA timeout after that the Window should be hidden from display. Default value is
0. -
$hideclickIf set to
true, then the Window is closed after the Player clicks on it. Default value isfalse.
Example
// Setup the styles
$settings_style = array(
'textcolor' => '09FF',
'backgroundcolor' => '0099FFDD',
'icon' => 'Icons64x64_1,ToolLeague1',
);
// Setup the columns
$settings_columns = array(
// Split Window into two (outer)columns
'columns' => 2,
// Each outer columns have two inner columns with 25% and 75% width
'widths' => array(25, 75),
// Left inner column text halign to 'left', the right to 'center'
'halign' => array('left', 'center'),
'textcolors' => array('FF5F', 'FFFF'),
'bgcolors' => array('555F', '333F'),
// Setup the headings
'heading' => array('Command', 'Description'),
);
// Build the data
$data = array(
'/help', 'Display help',
'/plugins', 'Display Plugins',
'/players', 'Display Players',
'/list', 'Display Maps',
);
// Setup content
$settings_content = array(
'title' => 'Currently supported chat commands',
'data' => $data,
'mode' => 'columns',
);
// Create the Window
$window = new Window();
$window->setStyles($settings_style);
$window->setColumns($settings_columns);
$window->setContent($settings_content);
$window->send($player, 0, false);
Class Window
Documentation of includes/core/window.class.php
Provides a comfortable, configurable styled Manialink window, with automatic handling of actions when a Player click on the pagination buttons.
Properties
| Members | Example data or description |
|---|---|
$window->layout |
Array for the given layout |
$window->settings |
Array for the given settings |
$window->content |
Array for the given content |
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
Windows is a registered trademark of Microsoft Corporation.

